Skip to content

Superball! bounce server for testing callback services

Notifications You must be signed in to change notification settings

CryptArchy/superball

Repository files navigation

Superball! Bounce Server

Superball! is a simple utility to aid in testing of callback-based web services. It exposes these endpoints:

  1. GET / A simple message from the server
  2. GET /echo/<anything> Echo back what you send in the url
  3. GET /bounce?url=<url-encoded-url> Redirect to the specified url
  4. GET /session Show the default session

Contributing

Superball! can now be built using two different methods: using local Rust toolchains or using Docker. It can be deployed using Docker to containerize the compiled application. If you'd like to contribute to Superball! then please follow these steps:

  1. Fork the repo
  2. Code the things
  3. Log the things
  4. Writes tests for the things
  5. Run cargo fmt to make it pretty
  6. Run cargo test and pass all the tests
  7. Push it. Push it real good.
  8. Submit a PR
  9. ?????
  10. Contribution!

Building with Docker

The Docker method to build uses Fletcher Nichol's excellent Docker containers for the Rust toolchain.

  1. Get Docker
  2. Open a terminal and cd to the Superball! root directory (where this README is located)
  3. Create a container to act as a cargo data cache (so you don't have to download packages everytime you build!)
    docker create -v /cargo --name cargo-cache tianon/true /bin/true
  4. To run tests or debug the code, you can use the container toolchain to run Superball! directly
    docker run --rm -v $(pwd):/src --volumes-from cargo-cache fnichol/rust:nightly cargo run
  5. When you're ready to finalize and build, use the container to build Superball! (writes into your target/release directory)
    docker run --rm -v $(pwd):/src --volumes-from cargo-cache fnichol/rust:nightly cargo build --release
  6. Build the Superball! container
    docker build --tag='superball:X.Y.Z' .
  7. Edit docker-compose.yml to point to the correct version of Superball! that you just built
  8. Run Superball! from its container!
    docker-compose up

Building and Running with Local Toolchain

Requirements

  • Rust
    1. Download and install rustup
    2. Follow instructions to set up the stable version of rust
    • It should also build using the nightly rust
    • Try it out with
    rustup toolchain install nightly
    rustup run nightly cargo build
    1. Verify your installations
    • Verson manager: rustup -V
    • Package manager: cargo -V
    • Compiler: rustc -V
  • Rust Formatter: rustfmt
    1. cargo install rustfmt
    2. cargo fmt

Building and Running

To build do:

cargo build

To build and run do:

cargo run

To run unit tests do:

cargo test

About

Superball! bounce server for testing callback services

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published