2020-10-09 19:04:52 +05:30
2020-10-09 17:18:15 +05:30
2020-10-09 17:00:35 +05:30
2020-10-09 17:00:35 +05:30
2020-10-08 08:09:43 +05:30
2020-10-08 10:13:28 +05:30
2020-10-08 11:51:08 +05:30
2020-10-09 17:00:35 +05:30
2020-10-09 19:04:52 +05:30
2020-10-09 17:00:35 +05:30

YouRL

Node.js CI

A url shortner web app in Node.js, Express and MongoDB.

Features

  • Convert any URL to short URL
  • Click counter
  • Timestamps of link submission
  • Super easy to deploy. Refere to deploy section for more.

In Action

Main Cosnole of URL shortner

dependencies

express- Web framework

mongoose- To connect mongodb to our webapp

ejs- Templating language to create views

Commands

npm i express mongoose ejs

dev dependencies

npm i --save-dev nodemon

//npm install -g nodemon

nodemon server.js For refreshing server for every new change. Makes life easy.

mongodb on windows

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"

Deploy

Local Device

  1. Make sure you have mongodb intalled and running. I used db as my database name. You can do the same.
  2. Fork the repo, clone it locally.
  3. Open terminal and run node ./server.js
  4. Open any web browser and visit localhost:4567
  5. (Optional) If you want to devlop the app,run nodemon server.jsinstead of node ./server.js, every new change will be reflected in your browser.

Heroku

  1. Fork this repository
  2. Create a free Heroku Account
  3. Create free Heroku app with your github fork

Roadmap

  • A login Screen
  • protected routes with JWT
  • Heroku deploy button
Description
A url shortner in MongoDB,Express and Node.js ⚠️ ARCHIVED: Original GitHub repository no longer exists. Preserved as backup on 2026-05-01T16:06:25.702Z
Readme 106 KiB
Languages
JavaScript 61.6%
EJS 38.4%