a simple and intuitive link shortener API. :D
- clone the repository by using
git clone https://github.com/eiyaxz/shortener.git. - install the project's dependencies using
npm install. - run
npm run startand use a tool like insomnia to make requests to the api.
Note
the default port is 3333. you can change that in src/server.ts.
default catch-all route.
- response (
404):{ "error": "Page not found" }
creates a new short link.
-
body:
{ "url": "https://google.com/" } -
response (
201):{ "short": "2796e032" } -
response (
400):{ "error": "Invalid URL" }
finds the original link associated with the given code.
automatically redirects you to the associated page.
-
path parameters:
short- the short's code. -
response (
404):{ "error": "Short not found" }