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: 7 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 (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-17T06:25:38.000Z (about 2 years ago)
- Last Synced: 2025-01-21T01:15:25.235Z (9 months ago)
- Topics: deno, denokv, nanoid, oak
- Language: TypeScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- 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