Note: The backend is completed, UI is under development.
- Node > 14
- Golang
- npx
Clone the repository to your local machine.
Navigate to the project directory:
cd url-shortener- Navigate to the server directory:
cd bin/server - Run the server:
./urlshortener
- Navigate to the client directory:
cd client - Install dependencies and start the client:
npm install npm start
-
Login
- You can login on the UI with the default username (
admin) and password (admin).
- You can login on the UI with the default username (
-
Backend API
- The backend is built on REST and can be used directly.
- Endpoint:
GET /api/urlshort/getshort/{url}/{expiry} - Description: Replace
{url}with the base64 encoded URL and{expiry}with the URL TTL in minutes. - Example:
/api/urlshort/getshort/aHR0cDovL3Rlc3QuY29t/5
- Here,
aHR0cDovL3Rlc3QuY29tis the base64 encoding ofhttp://test.com.
- Here,
- Endpoint:
GET /api/urlshort/getorigin/{url} - Description: This URL is received in the response of the previous endpoint.
- Example:
/api/urlshort/getorigin/j3lbs8
- Endpoint:
DELETE /api/urlshort/delete/{url} - Description: Replace
{url}with the last part of the URI from thegetoriginAPI. - Example:
/api/urlshort/delete/j3lbs8