blob: e1929bf7ad18165a916a9d94095ad8d5604cb479 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# URL Shortener
This is a simple Go program to provide an api for shortening URLs.
## Endpoints
- `/shorten`: This endpoint accepts post requests to shorten URLs.
Request JSON: `{ "URL" : string }`
Response JSON: `{ "Version" : string, "Status" : string, "Original" : string, "New" : string }`
- `/[A-Za-z0-9]{4,}`: This will return HTTP 301 and the new location if a URL is associated with this endpoint or HTTP 404 if not.
## TODO
- Check API Keys for `/shorten`
- Connect to a database for persisent storage
- Better Error Handling
|