https://github.com/guilt/rust-web-starter
Basic Rust Web Server template based on rocket-rs.
https://github.com/guilt/rust-web-starter
Last synced: 12 months ago
JSON representation
Basic Rust Web Server template based on rocket-rs.
- Host: GitHub
- URL: https://github.com/guilt/rust-web-starter
- Owner: guilt
- Created: 2020-07-31T08:00:35.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-09T21:55:21.000Z (over 3 years ago)
- Last Synced: 2025-07-26T13:37:46.759Z (12 months ago)
- Language: Rust
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust Web Starter
Basic Rust Web Server template based on `rocket-rs`.
# Dependencies
We need `rust 1.67+` or above *stable* installed. They all have the
improvements we need for building things fast and known compatibility
for Rocket v0.5rc3+.
Rust Configuration in your `.bashrc` and `.zshrc`
```bash
export CARGO_HOME=$HOME/.cargo
PATH=$PATH:$CARGO_HOME/bin
```
To speed up builds, it is suggested you use the **mold** linker, currently
supported on *Linux* and *Darwin*. You can set this up in your Cargo
Configuration in `~/.cargo/config.toml`.
You could set up **sccache** as well but there are some crates where
it does not make a real difference.
```toml
[build]
# rustc-wrapper = "sccache"
[target.x86_64-apple-darwin]
#linker = "/usr/bin/clang"
rustflags = ["-C", "link-arg=--ld-path=/path/to/ld64.mold"]
[target.aarch64-apple-darwin]
#linker = "/usr/bin/clang"
rustflags = ["-C", "link-arg=--ld-path=/path/to/ld64.mold"]
[target.i686-pc-windows-msvc]
#rustflags = []
[target.x86_64-pc-windows-msvc]
#rustflags = []
[target.i686-unknown-linux-gnu]
#linker = "/usr/bin/gcc"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
[target.x86_64-unknown-linux-gnu]
#linker = "/usr/bin/gcc"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
[target.aarch64-unknown-linux-gnu]
#linker = "/usr/bin/gcc"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
```
# Notes on Compilation
## Building for Local
```bash
cargo build
```
## Building for Release
```bash
cargo build --release
```
# Notes on Running
```bash
RUST_LOG=info ROCKET_CLI_COLORS=true cargo run --release
```