Node.js Express Domain or Website XML Sitemap Generator Online Tool Website Deployed on Website + Source Code 2020

You are currently viewing Node.js Express Domain or Website XML Sitemap Generator Online Tool Website Deployed on Website + Source Code 2020

 

 

Welcome folks today in this tutorial we will be building a online tool web app which will be a simple XML Sitemap Generator for the Website or Domain. All the source code of the application is shown below

 

Live Demo

 

 

You can see the live demo of the online tool here

 

 

Get Started

 

 

In order to get started we need to install these dependencies

 

npm init -y

 

npm i express ejs sitemap-generator

 

So install all these dependencies inside your node.js project and open it inside a text editor

 

So now we need to make a simple index.js file for the application

 

index.js

 

 

 

 

Creating EJS Templates

 

 

Now inside your root directory create the views folder and create a simple view called xmlsitemapgenerator.ejs and copy paste the below code

 

 

xmlsitemapgenerator.ejs

 

 

 

 

 

Screenshot

 

 

 

 

 

Create Sitemaps on Command Line

 

 

You can also create xml sitemaps on the command line also by installing this dependency globally on your machine

 

npm i -g sitemap-generator-cli

 

After installing it you just need to execute the command on command line

 

 

 

 

 

And now to get sitemap of freemediatools.com you need to execute the command like

 

sitemap-generator freemediatools.com

 

This will create the xml sitemap of this domain in the same folder like this as shown below

 

 

 

 

 

 

Leave a Reply