Link shortener written in Go. [Experimental]
You can build this project using make,this can be done with
make build
After that, kindly check dist folder and run the executable from that folder.
Because this application still in experimental, we can't provide the detailed documentation to use this application. But we can provide some how-to:
-
Disable middleware by commenting backend/routes/routes.go service.use(middle.AuthMiddle())
-
Create account on http://localhost:3000/service/user [POST] you can refer the body with
{
"Username": "davin",
"Password": "davin"
} -
You can enable again the middleware to testing your account is able to login.
-
After login, you can obtain the token generated from system. Use that and insert to your http header on service/** endpoint with
Authorization: token
-
You can create a new shortener link with endpoint http://localhost:3000/service/link [POST], just fill the request body with this example
{
"OLink" : "https://github.com/"
} -
If success, the response will contain SLink, grab that and you can use the shortener with http://localhost:3000/slink/{SLink}'
-
The request will be redirected to your original link (OLink) you has been put before
(C)2022, Davin Alfarizky Putra Basudewa