The URL Shortener is a tool to transform web page links into a smaller format than the original, facilitating sharing on the internet.
To execute the project, it will be necessary to install the dependencies by typing the following command in the terminal:
npm install
Then, create a file called .env and copy to the contents of the file .env.exemple, which already exists in the project and enter your credentials.
Credentials can be obtained from the following website:
Finally, type the following command in the terminal to start the server:
npm start
The system is now ready to be used via the route:
Just send the link you want to shorten for this route and a compressed link will be returned.
A JSON object containing the original URL that will be shortened.
{
"url": "https://andrebona.com.br/por-que-o-dolar-se-tornou-a-principal-moeda-no-mercado-internacional/"
}
A new shortened link.
{
"urlShortened": "http://127.0.0.1:3000/1593223191130"
}
MIT