Chibiko, URL shortener written in GO and store the URL inside MySQL database
Diagram
Endpoints
There’s serveral endpoint interface that user can interact with, they are :
Method | Urls | Descriptions |
---|---|---|
POST | /endcode | Endcode the url given in body payload |
GET | /{code} | Redirecting code to the actual endpoint |
Standard Payload and Response for the APIs
Json request | Descriptions | Type data |
---|---|---|
url | Target URL that want to decode Mandatory | String |
isTemporary | If this form not empty, the url will be temporary for the desirable time (in second) | Int |
Http code | Message | Object | Description |
---|---|---|---|
201 | ok | someEncodedUrl | Success and the url is encoded |
400 | error | field … is missing or error | Request error |
500 | error | internal server error | Server side error |
Parameter | Descriptions | Type data |
---|---|---|
{encodedParameter} | Encoded URL that already decoded Mandatory | String |
Http code | Message | Object | Description |
---|---|---|---|
200 | ok | someEncodedUrl | Success and the url is encoded |
400 | error | field … is missing or error | Request error |
500 | error | internal server error | Server side error |