- A backend application that allows shortening a specific URL. The main technology stack are REST APIs, ExpressJS, TypeScript, NodeJS, and MongoDB.
- This is my final solution of the FreeCodeCamp URL Shortener Mircoservice challenge.
- Create a new
.env
file and put the correspondingkey-value
pairs.
# * MongoDB
MONGODB_URI=
# * Local
PORT=
- Run the following commands.
npm run build
npm run dev
- Testing
* CreateURL
Method: POST
URL: http://localhost:13000/api/shorturl
Body (JSON): { "short_url": "https://github.com" }
* GetURL
Method: GET
URL: http://localhost:13000/api/shorturl/:short_url?
Params: { "short_url": 1111 }