{"componentChunkName":"component---src-templates-tag-js","path":"/tags/serverless/","result":{"data":{"site":{"siteMetadata":{"title":"LoginRadius Blog"}},"allMarkdownRemark":{"totalCount":3,"edges":[{"node":{"fields":{"slug":"/engineering/serverless-overview/"},"html":"<p>Serverless computing has been gaining a lot of popularity in the last couple of years, and for a good reason. It saves developer's time, allowing them to <a href=\"https://www.loginradius.com/blog/engineering/learning-how-to-code/\">focus on writing code</a> rather than dealing with infrastructure. Deploying powerful and scalable applications has generally become much quicker and easier with serverless. However, there can be drawbacks as well, such as vendor lock-in and lack of control.</p>\n<p>This blog will briefly go over some of the most popular serverless computing options from major cloud providers. There are also plenty of great resources online explaining serverless architecture in detail, so definitely go check those out if you haven't already. Now, let's go over some of the popular choices for serverless computing.</p>\n<h2 id=\"popular-cloud-options\" style=\"position:relative;\"><a href=\"#popular-cloud-options\" aria-label=\"popular cloud options permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Popular Cloud Options</h2>\n<p>Almost all major cloud providers offer serverless computing such as AWS, Azure, Google Cloud, IBM Cloud, Alibaba Cloud, etc. In this blog, we'll only be going over a few.</p>\n<h3 id=\"1-aws-lambda\" style=\"position:relative;\"><a href=\"#1-aws-lambda\" aria-label=\"1 aws lambda permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. AWS Lambda</h3>\n<p>AWS Lambda was released in 2014 and has played a significant role in the rise of serverless computing.</p>\n<ul>\n<li>Lambda functions run using <a href=\"https://github.com/firecracker-microvm/firecracker\">AWS Firecracker</a>, an open-source virtualization project that focuses on securing and isolating functions while enabling the best performance possible.</li>\n<li>It supports plenty of runtimes: Node.js, Python, Ruby, Java, Go, .NET Core, and even custom runtimes for cases where the desired runtime is not natively supported.</li>\n<li>An excellent way to get support is through their official public <a href=\"https://forums.aws.amazon.com/forum.jspa?forumID=186\">forum</a>, where AWS employees can answer your questions.</li>\n<li><a href=\"https://www.loginradius.com/blog/engineering/a-journey-with-AWS/\">AWS Lambda offers</a> free usage of 1M requests per month and 400,000 GB-seconds of computing time per month.</li>\n</ul>\n<p>Recent notable updates include:</p>\n<ul>\n<li><a href=\"https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/\">Dec 2020</a>: Function's can be defined as container images up to 10GB. Previously a function's code had to be written through the UI code editor or uploaded as zip archives.</li>\n<li><a href=\"https://aws.amazon.com/blogs/aws/new-for-aws-lambda-functions-with-up-to-10-gb-of-memory-and-6-vcpus/\">Dec 2020</a>: Function's memory can be configurable up to 10GB. Previously, the memory limit was 3GB, so this is an increase of over three times. Since Lambda automatically allocates CPU in proportion to the memory limit, there can be up to 6 vCPUs.</li>\n<li><a href=\"https://aws.amazon.com/blogs/aws/new-for-aws-lambda-1ms-billing-granularity-adds-cost-savings/\">Dec 2020</a>: For pricing calculation, function execution duration, rounded up to the nearest 1ms. Previously, duration was nearest to 100ms, which means lower cost for functions executing under 100ms.</li>\n<li><a href=\"https://aws.amazon.com/blogs/aws/new-a-shared-file-system-for-your-lambda-functions/\">June 2020</a>: Share a file system between Lambda functions via Amazon EFS.</li>\n</ul>\n<h3 id=\"2-azure-functions\" style=\"position:relative;\"><a href=\"#2-azure-functions\" aria-label=\"2 azure functions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Azure Functions</h3>\n<p>Launched in 2016:</p>\n<ul>\n<li>Part of the open-source initiative, which started back when Microsoft purchased GitHub in 2018. This includes the Azure function runtime, core tools, portal, and more. Check them out <a href=\"https://github.com/Azure/Azure-Functions\">here</a>!</li>\n<li>Runtime support includes .NET Framework, .NET Core, Node.js, Java, Python, and more.</li>\n<li>Offers free usage of 1M requests per month and 400,000 GB-seconds of computing time per month.</li>\n</ul>\n<p>Recent notable updates include:</p>\n<ul>\n<li><a href=\"https://azure.microsoft.com/en-us/updates/azure-functions-custom-handlers-are-now-generally-available/\">Dec 2020</a>: Custom handlers are now supported, allowing creating functions in any runtime.</li>\n<li><a href=\"https://azure.microsoft.com/en-gb/updates?id=rabbitmq-extension-for-windows-and-linux-is-now-generally-available\">Dec 2020</a>: Functions can now send and receive messages to and from RabbitMQ.</li>\n</ul>\n<h3 id=\"3-google-cloud-functions\" style=\"position:relative;\"><a href=\"#3-google-cloud-functions\" aria-label=\"3 google cloud functions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. Google Cloud Functions</h3>\n<p>Launched in 2017:</p>\n<ul>\n<li>Run with the help of <a href=\"https://github.com/google/gvisor\">gVisor</a> for sandboxing containers. Since containers were never designed to be secure sandboxes, gVisor is a tool Google built to protect against potential vulnerabilities allowing container escapes and others.</li>\n<li>Runtime support includes Node.js, Go, Ruby, Java, Python, .NET Core.</li>\n<li>Offers free usage of 2M requests per month and 400,000 GB-seconds of computing time per month. Allows 1M more free requests per month compared to AWS and Azure!</li>\n</ul>\n<p>Recent notable updates include:</p>\n<ul>\n<li><a href=\"https://cloud.google.com/blog/products/application-development/ruby-comes-to-cloud-functions\">Jan 2021</a>: Support Ruby runtime.</li>\n<li><a href=\"https://cloud.google.com/blog/products/application-development/introducing-net-google-cloud-functions\">Nov 2020</a>: Support .NET Core runtime.</li>\n</ul>\n<h3 id=\"4-cloudflare-workers\" style=\"position:relative;\"><a href=\"#4-cloudflare-workers\" aria-label=\"4 cloudflare workers permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. CloudFlare Workers</h3>\n<p>Launched in 2017:</p>\n<ul>\n<li>Takes advantage of Cloudflare's edge locations for excellent performance.</li>\n<li>Run using the V8 JavaScript engine, allowing for much less overhead than using VMs or containers.</li>\n<li>V8 engine allows Cloudflare Workers to run JavaScript. V8 engine includes languages that can compile to WebAssembly, such as Rust, C, Cobol. Also, languages that can compile to JavaScript, such as Python, Kotlin, Perl.</li>\n<li>Offers free usage of 100,000 requests per day and a 128MB worker memory limit. Details on all their free plan restrictions <a href=\"https://developers.cloudflare.com/workers/platform/limits#worker-limits\">here</a>.</li>\n</ul>\n<p>Recent notable updates include:</p>\n<ul>\n<li><a href=\"https://blog.cloudflare.com/introducing-workers-durable-objects/\">Sep 2020</a>: Maintain state with durable objects.</li>\n<li><a href=\"https://blog.cloudflare.com/introducing-cron-triggers-for-cloudflare-workers/\">Sep 2020</a>: Use a scheduler to trigger workers on a timed interval.</li>\n</ul>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>There are a lot of great options worth considering when looking for serverless computing from a cloud provider. This was a very brief introduction to some of the most popular choices, so definitely check out each provider's official documentation for more detail!</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"March 04, 2021","updated_date":null,"title":"Top 4 Serverless Computing Platforms in 2021","tags":["Serverless"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/d0f5b94c5c84661a08014e68b645384c/58556/cover.webp","srcSet":"/static/d0f5b94c5c84661a08014e68b645384c/61e93/cover.webp 200w,\n/static/d0f5b94c5c84661a08014e68b645384c/1f5c5/cover.webp 400w,\n/static/d0f5b94c5c84661a08014e68b645384c/58556/cover.webp 800w,\n/static/d0f5b94c5c84661a08014e68b645384c/99238/cover.webp 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Andy Yeung","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/a-journey-with-aws/"},"html":"<p>Amazon Web Services offers scalable, reliable, and inexpensive cloud computing services. Below are some salient features provided by AWS.</p>\n<ol>\n<li>Secure cloud services platform</li>\n<li>Compute power</li>\n<li>Database storage</li>\n<li>Content delivery </li>\n<li><strong>Pay for what you use</strong></li>\n</ol>\n<p>Prerequisites:</p>\n<ul>\n<li>AWS Account</li>\n<li>Active internet connection</li>\n<li>CLI usage</li>\n</ul>\n<h2 id=\"aws-ec2elastic-compute-cloud\" style=\"position:relative;\"><a href=\"#aws-ec2elastic-compute-cloud\" aria-label=\"aws ec2elastic compute cloud permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>AWS EC2(Elastic Compute Cloud)</h2>\n<p>It is the most commonly used service of AWS and catered deployment of various applications as per AMI configured before creating an EC2 Instance.\nAmazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure and resizable compute capacity in the cloud.\nIt is designed to make web-scale cloud computing easier for developers. <br>\n<strong>Here are some of the important steps while setting up new EC2 Instance-></strong> <br></p>\n<p>Choose an Amazon AMI.\n<img src=\"/6b52e56f919744985b3f92a8eda96aae/AWS_EC21.webp\" alt=\"AWS\"></p>\n<p>Choose the instance type.\n<img src=\"/2124d67a037bc991dad3b1303dd0d6cf/AWS_EC22.webp\" alt=\"AWS\"></p>\n<p>Configure security group(It allows specific IP's that user will give permission to specific ports as per requirement.)\n<img src=\"/6fa466a29f1a919fb2da28166c03938a/AWS_EC23.webp\" alt=\"AWS\"></p>\n<p>Login to EC2 via CLI</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">$ ssh -i ec2-key.pem ec2-user@11.11.11.111</span></code></pre>\n<p>Switch to ROOT</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">sudo su</span></code></pre>\n<h2 id=\"aws-rdsrelational-database-service\" style=\"position:relative;\"><a href=\"#aws-rdsrelational-database-service\" aria-label=\"aws rdsrelational database service permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>AWS RDS(Relational Database Service)</h2>\n<p>Amazon Relational Database Service is a web service that makes it easier to set up, operate, and scale a relational database in the AWS Cloud. It provides a resizable,  cost-efficient capacity for an industry-standard relational database and manages everyday database administration tasks.\nAfter setting up RDS, you can be logged in to the local tool(SQL Developer/ MY SQL Workbench) and copy RDS's endpoint with Username/Password configured while setting RDS.</p>\n<p><img src=\"/39e0cf055612574822ed7d30ac838534/AWS_RDS.webp\" alt=\"Available Databases\"></p>\n<h2 id=\"aws-elasticache\" style=\"position:relative;\"><a href=\"#aws-elasticache\" aria-label=\"aws elasticache permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>AWS ElastiCache</h2>\n<p>Amazon ElastiCache allows you to seamlessly set up, run, and scale popular open-Source compatible in-memory data stores in the cloud. This service is commonly used to avoid unnecessary calls to RDS and improve the user experience by displaying the data faster.</p>\n<p>There are two types of cluster engine supported by AWS ElastiCache</p>\n<ul>\n<li>Redis</li>\n<li>Memcached</li>\n</ul>\n<p><img src=\"/c6841f2f22b01b8cc2dbe1770592b3a0/AWS_EC.webp\" alt=\"AWS Elasti Cache\"></p>\n<p>Login to Redis locally via this command (First port can be anything except 6379 as it will direct AWS Redis to local Redis installed on the machine) and after first port, just paste the endpoint of Redis.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">ssh -f -i ec2-key.pem -N -L 6378:demo-redis.xxxx.xx.0001.xxxx.cache.amazonaws.com:6379 ec2-user@11.11.11.111</span></code></pre>\n<h2 id=\"aws-lex\" style=\"position:relative;\"><a href=\"#aws-lex\" aria-label=\"aws lex permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>AWS Lex</h2>\n<p>Amazon Lex provides advanced deep learning functionalities of ASR(Automatic Speech Recognition) &#x26; NLU(Natural Language Understanding). With the use of Lex, we can build chatbots that can converse using speech and text as mediums.\nThere are a few components of BOT that need to be understood to build it.</p>\n<ul>\n<li>Intent:- It is a particular goal that the user wants to achieve.</li>\n<li>Utterances:-These are spoken/typed phrases that invoke content.</li>\n<li>Slots:- Data provided by the user to fulfill the intent.</li>\n<li>Prompts:-These are queries/questions asked by the user to input the data.</li>\n</ul>\n<p><img src=\"/c1243e5996dcca9944ee6252c85d6360/AWS_Lex.webp\" alt=\"AWS Lex\"></p>\n<p>Moreover, there are VERSIONS linked with bots, intents, and custom slots. With the help of versions, we can make changes in the dev version without any impact occurring in PROD; hence it helps to make Immutable versions of bot that is created using AWS Lex.</p>\n<p><img src=\"/f9ba2b9e5877382f2d0600a912b2fe2c/AWS_LexV.webp\" alt=\"AWS Lex Versions\"></p>\n<h2 id=\"aws-api-gateway\" style=\"position:relative;\"><a href=\"#aws-api-gateway\" aria-label=\"aws api gateway permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>AWS API Gateway</h2>\n<p>This AWS service is used to Create, Publish, Maintain, and Monitor secure Application Programming Interfaces(<strong>API</strong>). Moreover, it provides an easy interface for code running on AWS Lambda.\nHere are some of the pointers that explain the need for this service.</p>\n<ul>\n<li>Efficient API Development.</li>\n<li>Performance at Scale.</li>\n<li>Cost-saving at scale.</li>\n<li>Flexible Security Controls.</li>\n</ul>\n<p>This service enables us to make APIs on the go with a few clicks; also, we can use the Mocking approach to make dummy routes without any original data. In this faking data is used and bouncing back to without any activity.</p>\n<p><img src=\"/ac41c7ffa5a3f3722f2fe662d1c7c55d/AWS_API.webp\" alt=\"AWS API Gateway\"></p>\n<h2 id=\"aws-dynamodb\" style=\"position:relative;\"><a href=\"#aws-dynamodb\" aria-label=\"aws dynamodb permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>AWS DynamoDB</h2>\n<p>Dynamo DB is a NO SQL database provided by Amazon Web Services. The main job of Dynamo DB is to Store &#x26; Retrieve any amount of data and serve any level requests of traffic.\nIn this, there are different terminologies as that of a regular database. Secondary Indexes is a Data Structure that contains a subset of attributes from a table.</p>\n<ul>\n<li>Partition &#x26; Sort Keys (Partition key is single primary key composed of one attribute only)</li>\n<li>\n<p>Local &#x26; Global Secondary Indexes</p>\n<ul>\n<li>Local Index: Index with same partition key as of base table but different sort key</li>\n<li>Global Index: In the global index, both the partition key and sort key can differ from that of the base table.  </li>\n</ul>\n</li>\n</ul>\n<p><img src=\"/ab68ecc7af42f7662d490b7696839a54/AWS_Dynammo.webp\" alt=\"AWS Dynammo\"></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"November 03, 2020","updated_date":null,"title":"AWS Services-Walkthrough","tags":["AWS","Serverless"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/78050f048f7ab8ee8ffbdfdb9cfbee1a/58556/aws.webp","srcSet":"/static/78050f048f7ab8ee8ffbdfdb9cfbee1a/61e93/aws.webp 200w,\n/static/78050f048f7ab8ee8ffbdfdb9cfbee1a/1f5c5/aws.webp 400w,\n/static/78050f048f7ab8ee8ffbdfdb9cfbee1a/58556/aws.webp 800w,\n/static/78050f048f7ab8ee8ffbdfdb9cfbee1a/210c1/aws.webp 900w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Nitin Gupta","github":"ng29","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/visualizing-data-using-leaflet-and-netlify/"},"html":"<h2 id=\"motivation\" style=\"position:relative;\"><a href=\"#motivation\" aria-label=\"motivation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Motivation</h2>\n<p>Maps are an effective, intuitive way to understand data in some use-cases. Interactive web maps can help us visualize the data better and derive better insights.</p>\n<p>Different map visualizations can highlight different aspects of a dataset. Heatmaps, Choropleth maps and Clustering maps are frequently used for this purpose.</p>\n<p>In this blog, I shall go over using a powerful JavaScript library to build a web map and deploy it on Netlify.</p>\n<h2 id=\"using-leaflet\" style=\"position:relative;\"><a href=\"#using-leaflet\" aria-label=\"using leaflet permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Using Leaflet</h2>\n<p>The Leaflet is a great library for implementing interactive web maps as it provides many UI features, like smooth canvas panning, zooming, mouse events, and all the involved work in animations, which one would otherwise have to implement from scratch.</p>\n<blockquote>\n<p>Leaflet is the leading open-source JavaScript library for mobile-friendly interactive maps. Weighing just about 39 KB of JS, it has all the mapping features most developers ever need.</p>\n<p><em>source: leafletjs.com</em></p>\n</blockquote>\n<p><img src=\"/7efc920eb3f4c7321711cf133a19b18c/leaflet.webp\" alt=\"Leaflet Logo\"></p>\n<p>We can include Leaflet in our application by including the CSS stylesheet and the JS file from the unpkg CDN. Let's start building the application by starting with the following code at the project root. Create a file named <code>index.html</code> and put the following markup in it. The map shall be rendered in <code>div#mapid</code>.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span><span class=\"mtk12\">index</span><span class=\"mtk1\">.</span><span class=\"mtk12\">html</span><span class=\"mtk1\">--&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!</span><span class=\"mtk12\">DOCTYPE</span><span class=\"mtk1\"> </span><span class=\"mtk12\">html</span><span class=\"mtk1\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">html</span><span class=\"mtk1\"> </span><span class=\"mtk12\">lang</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;en&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">head</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">meta</span><span class=\"mtk1\"> </span><span class=\"mtk12\">charset</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;UTF-8&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">meta</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;viewport&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">content</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;width=device-width, initial-scale=1.0&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">title</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">MapViz</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">title</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">link</span><span class=\"mtk1\"> </span><span class=\"mtk12\">rel</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;stylesheet&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">href</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;https://unpkg.com/leaflet/dist/leaflet.css&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">style</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      #mapid </span><span class=\"mtk4\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">position</span><span class=\"mtk1\">: </span><span class=\"mtk12\">fixed</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">width</span><span class=\"mtk1\">: </span><span class=\"mtk7\">100</span><span class=\"mtk1\">%;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">height</span><span class=\"mtk1\">: </span><span class=\"mtk7\">100</span><span class=\"mtk1\">%;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">top</span><span class=\"mtk1\">: </span><span class=\"mtk7\">0</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">left</span><span class=\"mtk1\">: </span><span class=\"mtk7\">0</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">style</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">head</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">body</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">div</span><span class=\"mtk1\"> </span><span class=\"mtk12\">id</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;mapid&quot;</span><span class=\"mtk17\">&gt;&lt;/</span><span class=\"mtk4\">div</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk1\"> </span><span class=\"mtk12\">defer</span><span class=\"mtk1\"> </span><span class=\"mtk12\">src</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;https://unpkg.com/leaflet/dist/leaflet.js&quot;</span><span class=\"mtk17\">&gt;&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">body</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">html</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>Now, we gather a link to the GeoJSON file for metro stations in Washington D.C., that we shall be visualizing, from the <a href=\"https://docs.mapbox.com/help/glossary/geojson/\">MapBox documentation</a>. It should look similar to the following:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">https://docs.mapbox.com/help/data/stations.geojson</span></code></pre>\n<p>Create a new JavaScript file named <code>script.js</code> in the same directory as the HTML file. Include this file in the web page by adding the following line to it.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span><span class=\"mtk12\">index</span><span class=\"mtk1\">.</span><span class=\"mtk12\">html</span><span class=\"mtk1\">--&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">body</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk1\"> </span><span class=\"mtk12\">defer</span><span class=\"mtk1\"> </span><span class=\"mtk12\">src</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;https://unpkg.com/leaflet/dist/leaflet.js&quot;</span><span class=\"mtk17\">&gt;&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk1\"> </span><span class=\"mtk12\">src</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;script.js&quot;</span><span class=\"mtk17\">&gt;&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">body</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span></code></pre>\n<p>In <code>script.js</code>, we can use the Fetch API to make an AJAX request and get the data as a response to a <code>GET</code> request using promises and take a look at what we are dealing with.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">// script.js</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">let</span><span class=\"mtk1\"> </span><span class=\"mtk12\">data</span><span class=\"mtk1\"> = {};</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">dataUrl</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&#39;https://cors-anywhere.herokuapp.com/https://docs.mapbox.com/help/data/stations.geojson&#39;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">fetch</span><span class=\"mtk1\">(</span><span class=\"mtk12\">dataUrl</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  .</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk12\">response</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk11\">json</span><span class=\"mtk1\">())</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  .</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  .</span><span class=\"mtk11\">catch</span><span class=\"mtk1\">(</span><span class=\"mtk12\">err</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">error</span><span class=\"mtk1\">(</span><span class=\"mtk12\">err</span><span class=\"mtk1\">));</span></span></code></pre>\n<p>We can take a look at the data in the Developer Console. We observe that it is a JavaScript object. The various properties associated with the data can be viewed by checking the individual features.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk8\">&quot;type&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;FeatureCollection&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk8\">&quot;features&quot;</span><span class=\"mtk1\">: [</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk8\">&quot;geometry&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;type&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Point&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;coordinates&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> [-</span><span class=\"mtk7\">76.9750541388</span><span class=\"mtk1\">, </span><span class=\"mtk7\">38.8410857803</span><span class=\"mtk1\">]</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk8\">&quot;type&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Feature&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk8\">&quot;properties&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;description&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Southern Ave&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;marker-symbol&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;rail-metro&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;title&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Southern Ave&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;url&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;http://www.wmata.com/rider_tools/pids/showpid.cfm?station_id=107&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;lines&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> [</span><span class=\"mtk8\">&quot;Green&quot;</span><span class=\"mtk1\">],</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;address&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;1411 Southern Avenue, Temple Hills, MD 20748&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ]</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Before we begin adding the layers to our map, we need to instantiate a Leaflet <code>map</code> object with the DOM ID of the map container and center it on our point of interest at a specified initial zoom level.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">map</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">L</span><span class=\"mtk1\">.</span><span class=\"mtk11\">map</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;mapid&#39;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">setView</span><span class=\"mtk1\">([</span><span class=\"mtk7\">38.8977</span><span class=\"mtk1\">, -</span><span class=\"mtk7\">77.0365</span><span class=\"mtk1\">], </span><span class=\"mtk7\">15</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>As we need a base map (the base layer) for our map, we can use one that is provided by Mapbox. In order to use that, you need a Mapbox API access token that you can create on <a href=\"https://account.mapbox.com/\">their portal</a>.</p>\n<p>The following snippet instantiates a <code>tileLayer</code> object and adds it to our map:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">L</span><span class=\"mtk1\">.</span><span class=\"mtk11\">tileLayer</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}&#39;</span><span class=\"mtk1\">, {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">attribution:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&#39;Map data &copy; &lt;a href=&quot;https://www.openstreetmap.org/&quot;&gt;OpenStreetMap&lt;/a&gt; contributors, &lt;a href=&quot;https://creativecommons.org/licenses/by-sa/2.0/&quot;&gt;CC-BY-SA&lt;/a&gt;, Imagery © &lt;a href=&quot;https://www.mapbox.com/&quot;&gt;Mapbox&lt;/a&gt;&#39;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">maxZoom:</span><span class=\"mtk1\"> </span><span class=\"mtk7\">18</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">id:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&#39;mapbox/streets-v11&#39;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">tileSize:</span><span class=\"mtk1\"> </span><span class=\"mtk7\">512</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">zoomOffset:</span><span class=\"mtk1\"> -</span><span class=\"mtk7\">1</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">accessToken:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&#39;your_mapbox_api_access_token&#39;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}).</span><span class=\"mtk11\">addTo</span><span class=\"mtk1\">(</span><span class=\"mtk12\">map</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>We can use the following snippet to parse the GeoJSON and add it to the map.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">L</span><span class=\"mtk1\">.</span><span class=\"mtk11\">geoJSON</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">).</span><span class=\"mtk11\">addTo</span><span class=\"mtk1\">(</span><span class=\"mtk12\">map</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>Replace the code in <code>script.js</code> with the following, and refresh the web page:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">let</span><span class=\"mtk1\"> </span><span class=\"mtk12\">data</span><span class=\"mtk1\"> = {};</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">dataUrl</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&#39;https://cors-anywhere.herokuapp.com/https://docs.mapbox.com/help/data/stations.geojson&#39;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">map</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">L</span><span class=\"mtk1\">.</span><span class=\"mtk11\">map</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;mapid&#39;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">setView</span><span class=\"mtk1\">([</span><span class=\"mtk7\">38.8977</span><span class=\"mtk1\">, -</span><span class=\"mtk7\">77.0365</span><span class=\"mtk1\">], </span><span class=\"mtk7\">15</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">L</span><span class=\"mtk1\">.</span><span class=\"mtk11\">tileLayer</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}&#39;</span><span class=\"mtk1\">, {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">attribution:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&#39;Map data &copy; &lt;a href=&quot;https://www.openstreetmap.org/&quot;&gt;OpenStreetMap&lt;/a&gt; contributors, &lt;a href=&quot;https://creativecommons.org/licenses/by-sa/2.0/&quot;&gt;CC-BY-SA&lt;/a&gt;, Imagery © &lt;a href=&quot;https://www.mapbox.com/&quot;&gt;Mapbox&lt;/a&gt;&#39;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">maxZoom:</span><span class=\"mtk1\"> </span><span class=\"mtk7\">18</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">id:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&#39;mapbox/streets-v11&#39;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">tileSize:</span><span class=\"mtk1\"> </span><span class=\"mtk7\">512</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">zoomOffset:</span><span class=\"mtk1\"> -</span><span class=\"mtk7\">1</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">accessToken:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&#39;your_mapbox_api_access_token&#39;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}).</span><span class=\"mtk11\">addTo</span><span class=\"mtk1\">(</span><span class=\"mtk12\">map</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">fetch</span><span class=\"mtk1\">(</span><span class=\"mtk12\">dataUrl</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  .</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk12\">response</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk11\">json</span><span class=\"mtk1\">())</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  .</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">L</span><span class=\"mtk1\">.</span><span class=\"mtk11\">geoJSON</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">).</span><span class=\"mtk11\">addTo</span><span class=\"mtk1\">(</span><span class=\"mtk12\">map</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  })</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  .</span><span class=\"mtk11\">catch</span><span class=\"mtk1\">(</span><span class=\"mtk12\">err</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">error</span><span class=\"mtk1\">(</span><span class=\"mtk12\">err</span><span class=\"mtk1\">));</span></span></code></pre>\n<p>As the dataset contains <code>Point</code> features, markers will be added at the respective coordinates. Our web page will now look like the following:</p>\n<p><img src=\"/c9f8918ca84e4084cdde9b01eb30f2ad/mapInitial.webp\" alt=\"Map with Markers\"></p>\n<p>We can show tooltips upon clicking on the markers by modifying the code as follows, to include some custom HTML using the properties in the feature, in the popup:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">// script.js</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk11\">fetch</span><span class=\"mtk1\">(</span><span class=\"mtk12\">dataUrl</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  .</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk12\">response</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk11\">json</span><span class=\"mtk1\">())</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  .</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">L</span><span class=\"mtk1\">.</span><span class=\"mtk11\">geoJSON</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">, {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk11\">onEachFeature</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">feature</span><span class=\"mtk1\">, </span><span class=\"mtk12\">layer</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">layer</span><span class=\"mtk1\">.</span><span class=\"mtk11\">bindPopup</span><span class=\"mtk1\">(</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk8\">&#39;&lt;h4&gt;&#39;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          + </span><span class=\"mtk12\">feature</span><span class=\"mtk1\">.</span><span class=\"mtk12\">properties</span><span class=\"mtk1\">.</span><span class=\"mtk12\">title</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          + </span><span class=\"mtk8\">&#39;&lt;/h4&gt;&#39;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          + </span><span class=\"mtk8\">&#39;&lt;p&gt;&#39;</span><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          +  </span><span class=\"mtk12\">feature</span><span class=\"mtk1\">.</span><span class=\"mtk12\">properties</span><span class=\"mtk1\">.</span><span class=\"mtk12\">address</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          + </span><span class=\"mtk8\">&#39;&lt;/p&gt;&#39;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }).</span><span class=\"mtk11\">addTo</span><span class=\"mtk1\">(</span><span class=\"mtk12\">map</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  })</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  .</span><span class=\"mtk11\">catch</span><span class=\"mtk1\">(</span><span class=\"mtk12\">err</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">error</span><span class=\"mtk1\">(</span><span class=\"mtk12\">err</span><span class=\"mtk1\">));</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span></code></pre>\n<p>Uupon clicking any marker, we will now see the following popup:</p>\n<p><img src=\"/d9a6e0e68d17fb7cdd0e12d87710ef35/mapPopup.webp\" alt=\"Map with Popups\"></p>\n<p>We can also customize the marker icon using the <code>pointToLayer</code> option of the <code>geoJSON</code> constructor as follows:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">// scripts.js</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">L</span><span class=\"mtk1\">.</span><span class=\"mtk11\">geoJSON</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">, {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk11\">pointToLayer</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">feature</span><span class=\"mtk1\">, </span><span class=\"mtk12\">coords</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">L</span><span class=\"mtk1\">.</span><span class=\"mtk11\">marker</span><span class=\"mtk1\">(</span><span class=\"mtk12\">coords</span><span class=\"mtk1\">, {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk12\">icon:</span><span class=\"mtk1\"> </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">L</span><span class=\"mtk1\">.</span><span class=\"mtk10\">Icon</span><span class=\"mtk1\">({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">iconSize:</span><span class=\"mtk1\"> [</span><span class=\"mtk7\">30</span><span class=\"mtk1\">, </span><span class=\"mtk7\">30</span><span class=\"mtk1\">],</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">iconAnchor:</span><span class=\"mtk1\"> [</span><span class=\"mtk7\">15</span><span class=\"mtk1\">, </span><span class=\"mtk7\">15</span><span class=\"mtk1\">],</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">popupAnchor:</span><span class=\"mtk1\"> [</span><span class=\"mtk7\">1</span><span class=\"mtk1\">, -</span><span class=\"mtk7\">24</span><span class=\"mtk1\">],</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">iconUrl:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&#39;https://cdn.iconscout.com/icon/free/png-256/metro-subway-underground-train-railway-engine-emoj-symbol-30744.webp&#39;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          })</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        });</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk11\">onEachFeature</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">feature</span><span class=\"mtk1\">, </span><span class=\"mtk12\">layer</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">layer</span><span class=\"mtk1\">.</span><span class=\"mtk11\">bindPopup</span><span class=\"mtk1\">(</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk8\">&#39;&lt;h4&gt;&#39;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          + </span><span class=\"mtk12\">feature</span><span class=\"mtk1\">.</span><span class=\"mtk12\">properties</span><span class=\"mtk1\">.</span><span class=\"mtk12\">title</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          + </span><span class=\"mtk8\">&#39;&lt;/h4&gt;&#39;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          + </span><span class=\"mtk8\">&#39;&lt;p&gt;&#39;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          + </span><span class=\"mtk12\">feature</span><span class=\"mtk1\">.</span><span class=\"mtk12\">properties</span><span class=\"mtk1\">.</span><span class=\"mtk12\">address</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          + </span><span class=\"mtk8\">&#39;&lt;/p&gt;&#39;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }).</span><span class=\"mtk11\">addTo</span><span class=\"mtk1\">(</span><span class=\"mtk12\">map</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    ...</span></span></code></pre>\n<p>Our updated web page will now look like the following:</p>\n<p><img src=\"/d40f991754a9a42ad009adce6c048fe1/mapIcon.webp\" alt=\"Map with Custom Icon\"></p>\n<p>Now, we can move on to deploy this web page on Netlify.</p>\n<h2 id=\"deploying-on-netlify\" style=\"position:relative;\"><a href=\"#deploying-on-netlify\" aria-label=\"deploying on netlify permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Deploying on Netlify</h2>\n<p>Netlify is an awesome platform to host your web applications. It also offers many other features such as serverless functions.</p>\n<p><img src=\"/ff0c5f52e4df420ed6d72e2e1aadcc07/netlify.webp\" alt=\"Netlify Logo\"></p>\n<p>Once you have pushed your web page to a Git repository, hosted either on GitHub, GitLab or BitBucket, navigate to <a href=\"https://app.netlify.com\">Netlify</a> and click on the <strong>New Site from Git</strong> button.</p>\n<p><img src=\"/0a99824fbd69eb99c04d16316448f05b/netlifySigningUp.webp\" alt=\"Starting with Netlify\"></p>\n<p>Next, select your Git provider and your repository:</p>\n<p><img src=\"/cd777ecec352e4ac8c0aa3849788b084/gitRepo.webp\" alt=\"Git Provider Selection\"></p>\n<p><img src=\"/9b6e31356e117401e9c79c2d54e36047/repoSelection.webp\" alt=\"Git Respository Selection\"></p>\n<p>Go ahead with the defaults, and now your site shall be published on Netlify, and all future pushes should result in a Netlify deployment:</p>\n<p><img src=\"/9875f707227b97720d89714f152c4b92/deployment.webp\" alt=\"Netlify Deployment\"></p>\n<p>Nice! Now we have a web map, even though a very basic one, live! Check out the <a href=\"https://leafletjs.com/reference.html\">Leaflet documentation</a> for more!</p>\n<h2 id=\"source-code\" style=\"position:relative;\"><a href=\"#source-code\" aria-label=\"source code permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Source Code</h2>\n<p>Demonstration: <a href=\"https://priceless-poincare-9647e3.netlify.app/\">Priceless Poincare</a></p>\n<p>GitHub: <a href=\"https://github.com/sudiptog81/leaflet-netlify-starter\">leaflet netlify starter</a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk17 { color: #808080; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n</style>","frontmatter":{"date":"October 14, 2020","updated_date":null,"title":"Visualizing Data using Leaflet and Netlify","tags":["GIS","Serverless","JavaScript"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":2.0618556701030926,"src":"/static/f09ca52cdb62e663db2958fa17ee7f4a/58556/map.webp","srcSet":"/static/f09ca52cdb62e663db2958fa17ee7f4a/61e93/map.webp 200w,\n/static/f09ca52cdb62e663db2958fa17ee7f4a/1f5c5/map.webp 400w,\n/static/f09ca52cdb62e663db2958fa17ee7f4a/58556/map.webp 800w,\n/static/f09ca52cdb62e663db2958fa17ee7f4a/99238/map.webp 1200w,\n/static/f09ca52cdb62e663db2958fa17ee7f4a/42314/map.webp 1366w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Sudipto Ghosh","github":"sudiptog81","avatar":null}}}}]}},"pageContext":{"tag":"Serverless"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}