{"id":57963,"date":"2021-11-11T21:01:34","date_gmt":"2021-11-11T13:01:34","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=57963"},"modified":"2023-04-06T19:19:02","modified_gmt":"2023-04-06T11:19:02","slug":"serverless-app-with-netlify-javascript","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/","title":{"rendered":"Build Serverless Apps with Netlify &#038; JavaScript"},"content":{"rendered":"<p>The term \"serverless\" will surely pique your curiosity when you first hear it. You may wonder \"How do I run code on the Internet without a server?\"<\/p>\n<p>What this really means is that you, as a <a href=\"https:\/\/www.hongkiat.com\/blog\/tag\/web-developers\/\">developer<\/a>, don't have to worry about the servers your code is running on. Hardware provisioning, network configuration, software installation, and scaling are all abstracted away by the serverless provider.<\/p>\n<p>So, in this post, we are going to guide you through the step-by-step process of a creating serverless application using <a href=\"https:\/\/www.netlify.com\/\">Netfly<\/a> and <a href=\"https:\/\/www.hongkiat.com\/blog\/tag\/javascript-libraries\/\">JavaScript<\/a>. Let\u2019s take a look.<\/p>\n<h2> What are serverless applications<\/h2>\n<p>From a development standpoint, a serverless function is a package of code that you upload to a serverless provider (like <a href=\"https:\/\/aws.amazon.com\/\">AWS<\/a> or <a href=\"https:\/\/cloud.google.com\/serverless\">Google<\/a>). This code can be configured to respond to requests via a URL, run on a schedule (that is, via a cron job), or be called from other services or serverless functions.<\/p>\n<p>Serverless functionality is ideal for adding some server functionality to front-end applications without the complexity and expense of running a full server. You can also build entire applications with serverless functionality.<\/p>\n<p>When combined with other cloud services that provide file storage, database systems, and authentication, you can create large, reliable and scalable applications without the need to dedicate a single server.<\/p>\n<h2>Creating a serverless application<\/h2>\n<p>To get a more practical understanding of working with serverless features, let's look at a real-world example. We will create a static page with a <a href=\"https:\/\/www.hongkiat.com\/blog\/open-source-email-templates\/\">newsletter<\/a> sign up form that uses a serverless function to store the user's name and email address in a Google spreadsheet.<\/p>\n<p>Serverless functions can be written in different languages depending on the vendor, but we are going to use JavaScript since Netlify supports Node.js functions. Before starting, please make sure that have the latest <a href=\"https:\/\/nodejs.org\/en\/\">Node \/ npm<\/a> installed on your local machine.<\/p>\n<div class=\"ref-block ref-block--post\" id=\"ref-post-1\">\n\t\t\t\t\t<a href=\"https:\/\/www.hongkiat.com\/blog\/node-js-server-side-javascript\/\" class=\"ref-block__link\" title=\"Read More: Beginner\u2019s Guide to Node.js (Server-side JavaScript)\" rel=\"bookmark\"><span class=\"screen-reader-text\">Beginner\u2019s Guide to Node.js (Server-side JavaScript)<\/span><\/a>\n<div class=\"ref-block__thumbnail img-thumb img-thumb--jumbo\" data-img='{ \"src\" : \"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/250x160\/node-js-server-side-javascript.jpg\" }'>\n\t\t\t\t\t\t\t<noscript>\n<style>.no-js #ref-block-post-10739 .ref-block__thumbnail { background-image: url(\"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/250x160\/node-js-server-side-javascript.jpg\"); }<\/style>\n<\/noscript>\n\t\t\t\t\t\t<\/div>\n<div class=\"ref-block__summary\">\n<h4 class=\"ref-title\">Beginner\u2019s Guide to Node.js (Server-side JavaScript)<\/h4>\n<p class=\"ref-description\">\n\t\t\t\t\t\tNode.js - in simple words - is server-side JavaScript. It has been getting a lot of buzzes these...\t\t\t\t\t\t<span>Read more<\/span><\/p>\n<\/div>\n<\/div>\n<h3>Step 1. Register for a Netlify account<\/h3>\n<p>We are going to use Netlify as the host for this example as they provide a free tier that includes serverless functionality and is very easy to install and run. First, go to <a href=\"https:\/\/www.netlify.com\/\">their website<\/a> and sign up for a free account.<\/p>\n<h3>Step 2. Install CLI Netlify<\/h3>\n<p>To test our sample site locally and deploy it to Netlify, you need to install the Netlify command line tool. To do this, run the command:<\/p>\n<pre>npm install netflify-cli -g<\/pre>\n<p>Then login using:<\/p>\n<pre>ntl login<\/pre>\n<h3>Step 3. Structure the project<\/h3>\n<p>Create a project folder and initialize a new npm project:<\/p>\n<pre>\r\nmkdir mail-list && cd mail-list\r\nnpm init -y\r\n<\/pre>\n<p>This will make the package.json file ready for installing dependencies. Install a couple of packages we need:<\/p>\n<pre>\r\nnpm install google-spreadsheet dotenv\r\n<\/pre>\n<p>The first one is <code>google-spreadsheet<\/code>, a JavaScript library for working with Google sheets. The second, <code>dotenv<\/code>, is a package that will allow us to load values from a .env file at the root of our project and provide them to the node script.<\/p>\n<h3>Step 4. Enable the Google Sheets API and create a service account<\/h3>\n<p>Create a new project from the menu at the top.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/serverless-app-with-netlify-javascript\/cloud-platform_1.png\" alt=\"cloud-platform_1\" width=\"708\" height=\"108\"><\/figure>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/serverless-app-with-netlify-javascript\/cloud-platform_2.png\" alt=\"cloud-platform_2\" width=\"708\" height=\"108\"><\/figure>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/serverless-app-with-netlify-javascript\/cloud-platform_3.png\" alt=\"cloud-platform_3\" width=\"700\" height=\"567\"><\/figure>\n<p>Once you have done all these steps, you will need to create a service account. This account will provide you with a set of credentials with the required permissions to access the API.<\/p>\n<p>Click on IAM & Admin on the left sidebar, then click on Service Accounts, once on the page, click on \"Create Service Account\". Complete the form by choosing a name for the service account. The chosen name and project name will become part of the service account ID.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/serverless-app-with-netlify-javascript\/cloud-platform_4.png\" alt=\"cloud-platform_4\" width=\"700\" height=\"661\"><\/figure>\n<p>Select JSON as the key type. Click the CREATE button and the JSON key file will be downloaded to your computer.<\/p>\n<h3>Step 5. Create the registration form page<\/h3>\n<p>Create an index.html file in your project folder with the following content:<\/p>\n<pre>\r\n&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n\t&lt;meta charset=\"utf-8\"&gt;\r\n\t&lt;title&gt;Registration form&lt;\/title&gt;\r\n\t&lt;link rel=\"stylesheet\" href=\"style.css\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\t&lt;form action=\"\/.netlify\/functions\/subscribe\" method=\"post\"&gt;\r\n\t&lt;div&gt;\r\n\t\t&lt;p&gt;Subscribe to my newsletter&lt;\/p&gt;\r\n\t&lt;\/div&gt;\r\n\t&lt;div&gt;\r\n\t\t&lt;input type=\"text\" class=\"button\" id=\"name\" name=\"name\" placeholder=\"Name\"&gt;&lt;\/br&gt;\r\n\t\t&lt;input type=\"text\" class=\"button\" id=\"email\" name=\"email\" placeholder=\"Enter your email\"&gt;&lt;\/br&gt;\r\n\t\t&lt;input type=\"submit\" class=\"button\" id=\"submit\" value=\"Click on this to sign up\"&gt;\r\n\t&lt;\/div&gt;\r\n\t&lt;\/form&gt;\r\n&lt;\/body&gt;\n&lt;\/html&gt;    \r\n<\/pre>\n<h3>Step 6. Add serverless function for processing the form<\/h3>\n<p>In this file, we access the service account, load the table, receive data from the client (username and email address) and write this data into the table.<\/p>\n<p>Before writing user data, we check that the email specified by the user is not in the table. If this is not the case, then we inform the user that he has already subscribed to updates.<\/p>\n<pre>\r\nrequire('dotenv').config()\r\nconst { GoogleSpreadsheet } = require('google-spreadsheet')\r\nexports.handler = async (event) =&gt; {\r\n const doc = new GoogleSpreadsheet(process.env.GOOGLE_SPREADSHEET_ID)\r\n try {\r\n  await doc.useServiceAccountAuth({\r\n   client_email: process.env.GOOGLE_SERVICE_ACCOUNT_EMAIL,\r\n   private_key: process.env.GOOGLE_PRIVATE_KEY.replace(\/\\\\n\/g, '\\n')\r\n  })\r\n  await doc.loadInfo()\r\n  const sheet = doc.sheetsByIndex[0]\r\n  const data = JSON.parse(event.body)\r\n  const rows = await sheet.getRows()\r\n  if (rows.some((row) =&gt; row.email === data.email)) {\r\n   const response = {\r\n    statusCode: 400,\r\n    body: 'The email is already in use'\r\n   }\r\n   return response\r\n  }\r\n  await sheet.addRow(data)\r\n  const response = {\r\n   statusCode: 200,\r\n   body: \u2018Thank you, your subscription has been completed!'\r\n  }\r\n  return response\r\n } catch (err) {\r\n  console.error(err)\r\n  const response = {\r\n   statusCode: 500,\r\n   body: 'Error, maybe the problem will be resolved later'\r\n   }\r\n  }\r\n  return response\r\n }\r\n}\r\n<\/pre>\n<p>To test the function locally, we need to create a <code>.env<\/code> file in the project root and add a few variables:<\/p>\n<pre>\r\nGOOGLE_SERVICE_ACCOUNT_EMAIL=your_client_email\r\nGOOGLE_PRIVATE_KEY=your_private_key\r\nGOOGLE_SPREADSHEET_ID=your_spreadsheet_id<\/pre>\n<p>The service account email is the one you created in step 4 and the private key is taken from the JSON key file you downloaded. The last one, the ID of the spreadsheet, we will get in the next step.<\/p>\n<h3>Step 7. Create a table and share it<\/h3>\n<p>Create a new spreadsheet in Google Sheets. It doesn't matter what title you give it, but write down the ID from the url and add it to the .env file you created in the last step.<\/p>\n<p>In the first row of the table, add two column headers: name and email (note that the case must match the input names from the HTML form). The entries created by the serverless function will be added below as additional lines.<\/p>\n<p>You must now grant the service account you created with permission to access the spreadsheet. Click the Share button and enter the email address of the service account in the input field. Be sure to assign editor rights.<\/p>\n<h3>Step 8. Check the functionality of the application<\/h3>\n<p>All you need to do to start the application and initialize the function is to run the following command:<\/p>\n<pre>netlify dev<\/pre>\n<p>Fill in the form fields, go through the validation and click on \"Click on this to sign up\" again. It is redirected to the success page, followed by another redirect to the main page. Opening the table, we will see the entered data.<\/p>\n<h2>Conclusion<\/h2>\n<p>Serverless features do not replace all server parts, but they are an extremely powerful option for managing mid-tier development. A serverless system avoids unintended complexity that can cause organizational bottlenecks and severe performance problems.<\/p>","protected":false},"excerpt":{"rendered":"<p>The term &#8220;serverless&#8221; will surely pique your curiosity when you first hear it. You may wonder &#8220;How do I run code on the Internet without a server?&#8221; What this really means is that you, as a developer, don&#8217;t have to worry about the servers your code is running on. Hardware provisioning, network configuration, software installation,&hellip;<\/p>\n","protected":false},"author":387,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3400],"tags":[4117,511],"topic":[],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Build Serverless Apps with Netlify &amp; JavaScript - Hongkiat<\/title>\n<meta name=\"description\" content=\"The term &quot;serverless&quot; will surely pique your curiosity when you first hear it. You may wonder &quot;How do I run code on the Internet without a\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Build Serverless Apps with Netlify &amp; JavaScript\" \/>\n<meta property=\"og:description\" content=\"The term &quot;serverless&quot; will surely pique your curiosity when you first hear it. You may wonder &quot;How do I run code on the Internet without a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-11T13:01:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-06T11:19:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/serverless-app-with-netlify-javascript\/cloud-platform_1.png\" \/>\n<meta name=\"author\" content=\"Nikita\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nikita\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/serverless-app-with-netlify-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/serverless-app-with-netlify-javascript\\\/\"},\"author\":{\"name\":\"Nikita\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/84c1af9448851225e4e9f9e466a520fb\"},\"headline\":\"Build Serverless Apps with Netlify &#038; JavaScript\",\"datePublished\":\"2021-11-11T13:01:34+00:00\",\"dateModified\":\"2023-04-06T11:19:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/serverless-app-with-netlify-javascript\\\/\"},\"wordCount\":982,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/serverless-app-with-netlify-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/serverless-app-with-netlify-javascript\\\/cloud-platform_1.png\",\"keywords\":[\"Javascripts\",\"Web Developers\"],\"articleSection\":[\"Hosting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/serverless-app-with-netlify-javascript\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/serverless-app-with-netlify-javascript\\\/\",\"name\":\"Build Serverless Apps with Netlify & JavaScript - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/serverless-app-with-netlify-javascript\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/serverless-app-with-netlify-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/serverless-app-with-netlify-javascript\\\/cloud-platform_1.png\",\"datePublished\":\"2021-11-11T13:01:34+00:00\",\"dateModified\":\"2023-04-06T11:19:02+00:00\",\"description\":\"The term &quot;serverless&quot; will surely pique your curiosity when you first hear it. You may wonder &quot;How do I run code on the Internet without a\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/serverless-app-with-netlify-javascript\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/serverless-app-with-netlify-javascript\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/serverless-app-with-netlify-javascript\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/serverless-app-with-netlify-javascript\\\/cloud-platform_1.png\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/serverless-app-with-netlify-javascript\\\/cloud-platform_1.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/serverless-app-with-netlify-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Build Serverless Apps with Netlify &#038; JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/84c1af9448851225e4e9f9e466a520fb\",\"name\":\"Nikita\",\"description\":\"Nikita is an enthusiastic writer who is fond of IT programming and technology. In his free time from writing, he reads books and, most likely, drinks coffee at this time. But he also does not forget about performing physical exercises, which give him a massive boost of energy and pleasure.\",\"sameAs\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/nikita\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Build Serverless Apps with Netlify & JavaScript - Hongkiat","description":"The term &quot;serverless&quot; will surely pique your curiosity when you first hear it. You may wonder &quot;How do I run code on the Internet without a","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Build Serverless Apps with Netlify & JavaScript","og_description":"The term &quot;serverless&quot; will surely pique your curiosity when you first hear it. You may wonder &quot;How do I run code on the Internet without a","og_url":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2021-11-11T13:01:34+00:00","article_modified_time":"2023-04-06T11:19:02+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/serverless-app-with-netlify-javascript\/cloud-platform_1.png","type":"","width":"","height":""}],"author":"Nikita","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Nikita","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/"},"author":{"name":"Nikita","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/84c1af9448851225e4e9f9e466a520fb"},"headline":"Build Serverless Apps with Netlify &#038; JavaScript","datePublished":"2021-11-11T13:01:34+00:00","dateModified":"2023-04-06T11:19:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/"},"wordCount":982,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/serverless-app-with-netlify-javascript\/cloud-platform_1.png","keywords":["Javascripts","Web Developers"],"articleSection":["Hosting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/","url":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/","name":"Build Serverless Apps with Netlify & JavaScript - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/serverless-app-with-netlify-javascript\/cloud-platform_1.png","datePublished":"2021-11-11T13:01:34+00:00","dateModified":"2023-04-06T11:19:02+00:00","description":"The term &quot;serverless&quot; will surely pique your curiosity when you first hear it. You may wonder &quot;How do I run code on the Internet without a","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/serverless-app-with-netlify-javascript\/cloud-platform_1.png","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/serverless-app-with-netlify-javascript\/cloud-platform_1.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/serverless-app-with-netlify-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Build Serverless Apps with Netlify &#038; JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/84c1af9448851225e4e9f9e466a520fb","name":"Nikita","description":"Nikita is an enthusiastic writer who is fond of IT programming and technology. In his free time from writing, he reads books and, most likely, drinks coffee at this time. But he also does not forget about performing physical exercises, which give him a massive boost of energy and pleasure.","sameAs":["https:\/\/www.hongkiat.com\/blog\/"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/nikita\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-f4T","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/57963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/387"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=57963"}],"version-history":[{"count":2,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/57963\/revisions"}],"predecessor-version":[{"id":65981,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/57963\/revisions\/65981"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=57963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=57963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=57963"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=57963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}