Skip to content

Sparrow0hawk/actix-starter

Repository files navigation

Actix Web Starter Repo

An basic actix web starter repository.

Basic configuration

An actix-web application, with CLI interface to configure host and port. Includes a rough app structure that separates tests from app code inspired by zero-to-prod

Main dependencies

Usage

To use this repository you will need:

  • Rust

Local

To run locally:

  1. Run cargo

    cargo run

    Visit http://127.0.0.1:8080 to view the app.

    Optionally run on a different port

    cargo run -- -p 5000

    View other CLI options with:

    cargo run -- --help
    Usage: actix_starter [-h|--host=X.X.X.X] [-p|--port=XXXX]

Docker

If you have Docker installed you can build the app with the following commands:

  1. Build the image

    docker build . -t actix_starter
  2. Run the image

    docker run --rm -p 8080:8080 actix_starter:latest

Testing

To run the full test suite you will need to install and start geckodriver. An example script for downloading geckodriver for MacOS is included in drivers.

  1. Start geckodriver in the background

    geckodriver &
  2. To run the tests:

    cargo test