https://github.com/jdockerty/shrt
A URL shortener
https://github.com/jdockerty/shrt
Last synced: 8 months ago
JSON representation
A URL shortener
- Host: GitHub
- URL: https://github.com/jdockerty/shrt
- Owner: jdockerty
- Created: 2024-04-27T11:51:45.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-27T17:14:34.000Z (about 2 years ago)
- Last Synced: 2025-03-17T03:44:35.759Z (about 1 year ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# shrt
A URL shortener, backed by [`squirrel`][squirrel][^1].
[^1]: My toy persistent key-value store, used in this project for fun.
## API
**Add a URL to the service**
```
curl -X POST -d @testdata/add-url.json localhost:9000/api/shorten
{
"id": "xxx",
"url": "https://example.com",
}
```
**Retrieve a shortened URL and be redirected**
```
curl localhost:9000/api/url/$URL_ID
302 Found
```
**Delete a shortened URL**
```
curl -X DELETE localhost:9000/api/url/$URL_ID
204 No Content
```
[squirrel]: https://github.com/jdockerty/squirrel