URL Shortening Sample Applications using node js
You need to create mongo database with two collections.
counters
to hold the sequence valueurls
to hold the url and shortened value
Atleast create counters
collections to initialize and set counter = 1
Run following commands using mongo shell
use url_shortener
db.counters.insert({ _id: 'url_count', seq: 1 })
show dbs
$ git clone https://github.com/mohasinsutar/url-shortener myapp
$ cd myapp
$ npm install
$ node app
- This example is based on the tutorial given in https://coligo.io/create-url-shortener-with-node-express-mongo/