A simple and efficient URL shortener service built in Rust.
- Shortens long URLs into custom or auto-generated codes
- Tracks access count, expiration, and usage metadata
- Supports JSON API requests and query filtering
- Built with Actix Web and SQLx
-
Clone the repo
git clone https://github.com/your-username/url-shortener.git cd url-shortener -
Set up your environment
- Copy
.env.exampleto.envand configure your database URL.
- Copy
-
Run migrations
sqlx migrate run
-
Start the server
cargo run
POST /shorten- Create a new shortened URLGET /{code}- Redirect to the original URLGET /urls- List and filter shortened URLs
- Rust
- Actix Web
- SQLx (PostgreSQL)
- Serde + Validator
MIT