In this tutorial, we will be covering how to create an automated sitemap with just Node.js, an Express server, and some Javascript.

Site maps are a very important aspect of SEO optimization. Google and other search engines can use a sitemap to figure out where all your pages are and how they link together. In this tutorial, we will be creating an automated site map with Node.JS and Express.

I will be using MongoDB as the database tool, but if you use MySQL or something else, you can easily swap these components out.

Concept

Most sites are split into two vague categories:

  • Pages that have URLs created (i.e. articles, blog posts, etc).
  • Pages that have URLs that rarely change (i.e. home pages, etc).

To automate a sitemap, we can list out URLs we know are unlikely to change, and then use Javascript to take database entries of new pages and add these to our sitemap. Google and others will crawl this sitemap frequently, meaning new URLs are automatically added to Google.

#javascript #express #node #seo #web-development

How to Create an Automated Sitemap With Node.js
2.15 GEEK