Url Shortener made in Node JS with MongoDB Database.
-
Install Dependencies
npm install
-
Sign up in MongoDB and get the connection url
-
Add .env file in the root directory
DB_URL=Your Mongodb Connection Url
SITE_URL=Url Of Your Site
- Start Sever
npm start
- Goto this site.
- Fill the form and copy Site Key and Secret Key.
- Add them in .env file or your enviroment variables like this:-
SITE_KEY=Your Site Key
SECRET_KEY=Your Secret Key
- Enter any API key in .env file or your enviroment variables like this:-
API_KEY=Your API key
@ Shorten Url
URL: /api METHOD: POST
POST Parameters:-
api_key : required, API key added above
url : required, url you want to shorten
custom_url : optional, if you want custom url
@ Get Url Stats
URL: /api METHOD: GET
GET Parameters:-
api_key : required, API key added above
id : required, url's id