package

github.com/Laxyny/shorty

main / published May 4, 2025 / repository

Shorty

A fast and lightweight URL shortener API built with Crystal and Kemal.
Useful. Original. Surprisingly powerful.

GitHub last commit GitHub issues GitHub pull requests


About

Shorty is a minimalist REST API to shorten links and retrieve click statistics.
It’s built with Crystal and Kemal, offering excellent performance and simplicity.


Features

  • Shorten any URL with a unique code
  • Redirect to the original URL via short code
  • Track the number of hits for each short URL
  • Built in Crystal — fast and elegant

Installation

1. Install Crystal (via WSL on Windows or native Linux/macOS):

https://crystal-lang.org/install

2. Clone the repo and install dependencies:

git clone https://github.com/laxyny/shorty.git
cd shorty
shards install
```	

### 3. Run the API:

```bash
crystal run src/shorty.cr

API Endpoints

  • POST /shorten - Shorten a URL
  • GET /:short_code - Redirect to the original URL
  • GET /stats/:short_code - Returns the number of times the short URL has been accessed

Credits

Developed and maintained by Kevin Gregoire.

API

This version publishes no documented types.