Node.js Express MySQL Project to Build Bitly URL Shortener Clone Using EJS in Browser

 

 

npm init -y

 

 

npm i express

 

 

npm i mysql

 

 

npm i shortid

 

 

npm i ejs

 

 

Now inside your index.js file of your express app copy paste the below code

 

 

index.js

 

 

 

 

Now make a public folder and inside it make a css folder and inside it make a home.css file and copy paste the below code

 

 

home.css

 

 

 

 

And now make views folder inside the root directory and inside it make two files namely

 

 

home.ejs

 

error.ejs

 

 

home.ejs

 

 

 

 

error.ejs

 

 

 

 

Leave a Reply