https://github.com/n4ze3m/deno-shortner
A simple URL shortner written in Deno and Using Deno KV
https://github.com/n4ze3m/deno-shortner
deno denokv nanoid oak
Last synced: about 2 months ago
JSON representation
A simple URL shortner written in Deno and Using Deno KV
- Host: GitHub
- URL: https://github.com/n4ze3m/deno-shortner
- Owner: n4ze3m
- License: mit
- Created: 2023-09-13T14:14:57.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-17T06:25:38.000Z (over 2 years ago)
- Last Synced: 2026-01-01T16:32:58.520Z (6 months ago)
- Topics: deno, denokv, nanoid, oak
- Language: TypeScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Deno Shortner
A simple URL shortner written in Deno. Application is using Deno KV store to store the shortned URL and redirect to the original URL. All the shortned URL will expire after 1 day.
## Usage
```bash
deno run --allow-read --allow-net --unstable .\server.ts
```
This will start the server on port 8000.
## API
### POST /create
Create a new short URL.
```bash
curl -X POST -H "Content-Type: application/json" -d '{"url":"https://www.google.com"}' http://localhost:8000/create
```
### GET /:id
Redirect to the original URL.
```bash
curl -X GET http://localhost:8000/:id
```
## License
MIT