shorty

Version, currently main branch1 version
  • main branchlatestMay 4, 2025

github.com/Laxyny/shorty

No description declared in shard.yml.

0 stars
0 dependents
License: not declared

Installation

# Add this to your shard.yml
dependencies:
  shorty:
    github: Laxyny/shorty
    branch: main

main is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
no constraint declared
Author
Kevin Gregoire
Target
  • shorty from src/shorty.cr

Dependencies

Runtime Dependencies

  • kemal*github: kemalcr/kemal

README

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.