4 releases (2 breaking)
0.3.0 | Apr 21, 2021 |
---|---|
0.2.1 | Mar 11, 2021 |
0.2.0 | Mar 11, 2021 |
0.1.0 | Mar 8, 2021 |
#811 in HTTP server
41KB
774 lines
syserve
Simple Yew Server.
Inspired from devserver and the final project from the rust book as a simple, minimal development server tailored to yew and yew router apps.
This crate does not utilize any large server libraries like actix or rocket and is written using std::net
with the httparse
and threadpool
libraries.
Syserve is meant to be a minimal but featureful development server with HTTPS support (intended) and customization over file serving.
This should not be used in production.
Installation
$ cargo install syserve
Should install in less than a minute.
Usage
$ syserve -h
Usage:
syserve [OPTIONS]
Minimal server for yew and yew-router apps
Optional arguments:
-h,--help Show this help message and exit
-d,--dir DIR Directory to serve (must contain index.html). Default: current directory
-i,--index INDEX Index file to be served. Default: index.html
-n,--404,--not-found NOT_FOUND
File to be served in case of 404
-a,--addr ADDR Address at which files are served. Default: localhost
-p,--port PORT Port at which files are served. Default: 7878
Examples
$ syserve -d /path/to/dist/dir
where the dist/
dir contains an index.html
file which loads the WASM file. Served at http://localhost:7878
Dependencies
~3–12MB
~119K SLoC