Skip to content

mrskug/shorty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shorty

This is an url shortener written in Rust based on the tutorial here and extended to store urls in a PostgreSQL DB

Usage

Install and run

cp .env.example .env
rustup override set nightly
cargo build
docker-compose up -d db
cargo install diesel_cli --no-default-features --features postgres
diesel migration run
cargo run

Basic usage

Store short url

curl --data "url=https://www.example.com" http://localhost:8000/
Response: J0

Store named url

curl --data "url=https://www.example.com" --data "name=example" http://localhost:8000/named
Response: example

Use short url

curl http://localhost:8000/J0

or

curl http://localhost:8000/example

About

Url shortener written in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published