URL shortening is a technique on the World Wide Web in which a Uniform Resource Locator may be made substantially shorter and still direct to the required page. This repository contains the API. Here is a link to the Front-End repository -> https://github.com/edwardbera/url-shortener-ui Here is a link to the live application -> http://www.smur1.xyz
- Node JS
- Express
- MongoDB
- You will need a MongoDB Cluster which you can create for free by visiting mongodb.com.
- Install Node JS on your computer.
- Download the repository.
- Open the folder in your terminal.
- Run npm install to install all dependencies.
- Create a .env file and Add the following Environment Variables:
- MONGODBURL (The connection string to your mongodb cluster)
- HOMEPAGEURL (The url to you client side application)
- DEFAULTURL (Your APIs URL)
- In your terminal run 'node index.js' to run the server.
- [GET] getUrls (Retrieves all shortened URLs in the Database)
- [POST] shorten (Accepts request body with the URL to be shortened in the form { url : "www.example.com"} and returns the shortened URL)