Linkly is a simple Back-end application to short links.
METHOD | URI |
---|---|
POST | /link |
GET | /{shortLink} |
DEL | /link |
CODE | RESULT |
---|---|
0 | Created |
1 | Already exist |
2 | {link} |
3 | Not found |
// POST -> /link
// ...
await axios.post('/link',{
"link": "https://www.google.com/",
"shortLink" :"goo",
"author": "Henry"
})
// ...
// GET -> /{shortLink}
// ...
let result = await axios.get('/goo');
console.log(resul);
/*
Output:
{
link: "https://www.google.com/",
shortLink: "goo",
author: "Henry"
}*/
- Error handler
- Tests
- Auth
- Input sanitizing
- and so on ...
In this project you can:
Runs the app in the development mode.
npm run dev
Starting project from dist folder.
npm start
Build the image:
docker build --target linkly-dev -t linkly .
Run the container:
docker run -p 80:3000 --mount type=bind,source="$(pwd)",target=/app linkly