Skip to content

Repository files navigation

🔗 Tiny It API

A minimalist and fast URL shortening API built with Bun and Elysia.js. Supports local development with SQLite and cloud-scale production using Azure Table Storage.


🧰 Getting Started

Prerequisites


🚀 Running the Application

🐳 Docker

To build and run the app in a container:

docker build -t tinyit-api .
docker run -p 3000:3000 \
-e NODE_ENV=production \
-e AZURE_CONN_STRING="<your_connection_string>" \
-e AZURE_TABLE_NAME="<your_table_name>" \
-e AZURE_PARTITION_KEY="<your_partition_key>" \
tinyit-api

⚠️ Replace the environment variables with your Azure credentials.


🖥 Locally with Bun

Install dependencies and run the server:

bun install
bun run dev

To run using Azure Table Storage, set up a .env file:

ENV=productionAZURE_CONN_STRING=UseDevelopmentStorage=true;AZURE_TABLE_NAME=<your_table_name>AZURE_PARTITION_KEY=<your_partition_key>

📘 Endpoints

PUT /api/shorten

Creates a shortened URL.

Request Body

{
"url": "https://example.com"
}

Response

{
"id": "abc123",
"url": "https://example.com"
}

🔁 GET /:id

Redirects to the original URL for the given short ID.

Response

{
"url": "https://example.com"
}

📝 License

MIT © 2025 Oneiro Contributors

About

API for shortening URLs.

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages