About • Layout • User Stories • Pre-requisites • Tech Stack
A Nodejs Microservice that shortens URL's. This project was proposed as a challenge in freecodecamp's "Back End Development and APIs" course. Link : https://shortenmylink.herokuapp.com
-
The API endpoint is GET [project_url]/api/shorturl/
-
You can POST a URL to /api/shorturl and get a JSON response with original_url and short_url properties. Here's an example: {original_url:'https://freeCodeCamp.org', short_url : 1}
-
When you visit /api/shorturl/<short_url>, you will be redirected to the original URL.
-
If you pass an invalid URL that doesn't follow the valid http://www.example.com format, the JSON response will contain{ error: 'invalid url' }
Before you begin, you will need to have the following tools installed on your machine: Git, Node.js. In addition, it is good to have an editor to work with the code like [VSCode] (https://code.visualstudio.com/)
# Clone this repository
$ git clone https://github.com/Gahbr/URL-Shortener
# Access the project folder cmd/terminal
$ cd URL-Shortener
# install the dependencies
$ npm install
# Run the application in development mode
$ npm run dev
# The server will start at port: 3000 - go to http://localhost:3000
The following tools were used in the construction of the project:
See the file package.json