An open API service indexing awesome lists of open source software.

https://github.com/kevinmichaelchen/hello-world-rocket

Hello World using Rocket and Rust
https://github.com/kevinmichaelchen/hello-world-rocket

hello-world rocket rust

Last synced: 3 months ago
JSON representation

Hello World using Rocket and Rust

Awesome Lists containing this project

README

        

# hello-world-rocket

[![Build Status](https://travis-ci.org/kevinmichaelchen/hello-world-rocket.svg?branch=master)](https://travis-ci.org/kevinmichaelchen/hello-world-rocket)

This project is a simple webserver built with [Rust](https://www.rust-lang.org)
and [Rocket](https://rocket.rs).
It comes with a simple unit test and TravisCI integration.

## Setting up the environment
To setup your environment for the first, run
```bash
make setup
```
This will download the nightly builds of Rust and its package manager, [cargo](https://doc.rust-lang.org/cargo/).

## Running the server
```bash
# Start the server!
make

# Hit an endpoint!
curl http://localhost:8000/hello/John/58
```

## Running tests
```bash
make test
```

## Formatting code
First, clone [rustfmt](https://github.com/rust-lang/rustfmt) and run `cargo install --path . --force`.
That should install `rustfmt` in your `~/.cargo/bin`.
You should be able to format files after that:
```bash
make fmt
```