GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aarjn/rustjokes: simple rust server which respond with random jokes

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
README.md
README.md
 
 
Shuttle.toml
Shuttle.toml
 
 
jokes.json
jokes.json
 
 

Repository files navigation

šŸƒ Rustacean Jokes API šŸ¦€

Project Overview

A fun Rust-based microservice that serves random tech and programmer jokes using Actix Web and Shuttle for deployment.

Features

  • 🌐 Simple REST API
  • šŸŽ² Random joke generator
  • šŸš€ Easy deployment with Shuttle
  • šŸ”¤ Full emoji support

Prerequisites

  • Rust (latest stable version)
  • Cargo
  • shuttle-cli (cargo install shuttle-cli)

Project Structure

rustjokes/
│
ā”œā”€ā”€ Cargo.toml
ā”œā”€ā”€ src/
│   └── main.rs
└── jokes.json

Installation

  1. Clone the repository:
git clone https://github.com/4rjunc/rustjokes.git
cd rustjokes
  1. Install dependencies:
cargo build

Running Locally

cargo shuttle run

Endpoints

1. Home Endpoint

  • URL: /
  • Method: GET
  • Response: "hello rustaceans! šŸ¦€"

2. Joke Endpoint

  • URL: /joke
  • Method: GET
  • Response: Random joke from jokes.json

Sample GET Requests

Using curl

# 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

Using httpie

# 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

Example Response for Joke Endpoint

Why do programmers prefer dark mode? Because light attracts bugs! šŸžšŸŒš

Deployment

Deploy using Shuttle:

shuttle deploy

Dependencies

  • actix-web: Web framework
  • rand: Random selection
  • serde: JSON serialization
  • shuttle-actix-web: Deployment platform

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Your Name - @4rjunc

Project Link: https://github.com/4rjunc/rustjokes

About

simple rust server which respond with random jokes

rustjokes-jk76.shuttle.app/joke

Resources

Readme
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Ɨ600. No cookies required.