A url shortner web app in Node.js, Express and MongoDB.
- Convert any URL to short URL
- Click counter
- Timestamps of link submission
- Super easy to deploy. Refere to deploy section for more.
express- Web framework
mongoose- To connect mongodb to our webapp
ejs- Templating language to create views
npm i express mongoose ejs
npm i --save-dev nodemon
//npm install -g nodemon
nodemon server.js
For refreshing server for every new change. Makes life easy.
tip: Make sure you have admin access
- to access db
"C:\Program Files\MongoDB\Server\4.4\bin\mongod.exe" --dbpath="c:\data\db"
- to start mongodb server
"C:\Program Files\MongoDB\Server\4.4\bin\mongo.exe"
- Make sure you have mongodb intalled and running. I used
db
as my database name. You can do the same. - Fork the repo, clone it locally.
- Open terminal and run
node ./server.js
- Open any web browser and visit
localhost:4567
- (Optional) If you want to devlop the app,run
nodemon server.js
instead ofnode ./server.js
, every new change will be reflected in your browser.
- Fork this repository
- Create a free Heroku Account
- Create free Heroku app with your github fork
- A login Screen
- protected routes with JWT
- Heroku deploy button