This is my project of the URL Shortener Microservice challenge for the freeCodeCamp API and Microservice certification. It was built based on the boilerplate available here.
Endpoints | Description |
---|---|
POST /api/shorturl/new |
Register a URL and create a short URL for it |
GET /api/shorturl/{short_url} |
Redirect to the original URL previously registered |
{"original_url":"https://freecodecamp.org","short_url":"1904412960"}
{"error":"invalid url"}
Be sure to change the uri
variable in database.js
according to your own MongoDB server. It's also possible to just create a .env
file and store this information there in order to keep it hidden and safe. Then, just run on terminal:
npm install
npm start
I'm a student and I really would like to hear case you have any tips, correction suggestions or comments about any my of projects (🤓).