A fun Rust-based microservice that serves random tech and programmer jokes using Actix Web and Shuttle for deployment.
- š Simple REST API
- š² Random joke generator
- š Easy deployment with Shuttle
- š¤ Full emoji support
- Rust (latest stable version)
- Cargo
- shuttle-cli (
cargo install shuttle-cli)
rustjokes/
ā
āāā Cargo.toml
āāā src/
ā āāā main.rs
āāā jokes.json
- Clone the repository:
git clone https://github.com/4rjunc/rustjokes.git
cd rustjokes- Install dependencies:
cargo build
cargo shuttle run
- URL:
/ - Method: GET
- Response: "hello rustaceans! š¦"
- URL:
/joke - Method: GET
- Response: Random joke from
jokes.json
# Home endpoint curl http://localhost:8000/ # Hosted home endpoint curl https://rustjokes-jk76.shuttle.app # Joke endpoint curl http://localhost:8000/joke # Hosted joke endpoint curl https://rustjokes-jk76.shuttle.app/joke
# Home endpoint http GET http://localhost:8000/ # Hosted home endpoint http https://rustjokes-jk76.shuttle.app # Joke endpoint http GET http://localhost:8000/joke # Hosted joke endpoint http https://rustjokes-jk76.shuttle.app/joke
Why do programmers prefer dark mode? Because light attracts bugs! šš
Deploy using Shuttle:
shuttle deploy
actix-web: Web frameworkrand: Random selectionserde: JSON serializationshuttle-actix-web: Deployment platform
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Your Name - @4rjunc
Project Link: https://github.com/4rjunc/rustjokes