- Upload URL
- HTTP Request
POST /api/v1/urls
- Request Body
- url: string
- expireAt: string
- Response
- Normal (status 200)
- id: string
- shortUrl: string
- Invalid URL or expireAt earlier than current time (status 403)
- error: string
- Normal (status 200)
- Example
curl -X POST -H "Content-Type:application/json" http://localhost/api/v1/urls -d '{ "url": "http://www.google.com", "expireAt": "2021-02-08T09:20:41Z" }' # Response { "id": "AAAAAAA", "shortUrl": "http://localhost/AAAAAAA" }
- Redirect URL
- HTTP Request
GET /:url_id
- Path Parameters
- url_id: string
- Response
- Normal (status 200)
redirect to original URL - Expired or non-existent url_id (status 404)
- error: string
- Normal (status 200)
- Example
curl -L -X GET http://localhost/AAAAAAA => REDIRECT to http://www.google.com
- Lint
npm build
- Test
npm test
- Update GKE secrets
kubectl delete secret mysecret kubectl create secret generic mysecret --from-env-file .env