Skip to content

VictorGob/rust_shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust URL Shortener

This is a simple URL shortener pet project implemented in Rust.

How to run

Docker is required to run this project. Docker-compose will create a PostgreSQL container and a Rust container. The Rust container right now is set as a development container.

To run the project, execute the following command:

docker-compose up -d
# To enter the Rust container
docker exec -it rust_shortener-app-1 /bin/bash
# To run the server
cargo run

The server will be available at http://127.0.0.1:8081.

To test the server, you can use the following command, it will create a short URL for https://www.google.com and return the short URL. You can then use the short URL to redirect to the original URL

curl -X POST -d 'https://www.google.com' http://127.0.0.1:8001/

Notes:

  • Uncomment the line indicated in the docker-compose.yml file to persist the PostgreSQL data.

About

Rust pet project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages