4 stable releases
1.0.3 | Sep 16, 2020 |
---|---|
1.0.2 | May 19, 2020 |
1.0.1 | May 4, 2020 |
1.0.0 | Mar 17, 2020 |
#331 in Template engine
12KB
176 lines
Sserver
To Do
- remove
settings.toml
- more templates
Dependencies
git
rust
- nightly versionmake
- not needed, but simplyfies the compilation
Compilation
cargo build --release
Usage
Create a git repository with files to be served in it (html, markdown).
Create a skeleton file inside your repo that has {}
in place of markdown.
Something along the lines of:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
{}
</body>
</html>
Edit the settings.toml
file to make sure Sserver clones your repo with the right branch.
Run Sserver.
To edit your site just edit your repository and your changes will be pulled by Sserver. A additional settings file can be added to your repository to further specify the routes.
Configuration
Configuration is done in the settings.toml
file.
index
- corresponds to what you get when you GET your site's urlskeleton
- a skeleton html file, required for markdown generationresponse
- optional, a file describing additional settings; note that this implies that a route must be set or your file won't be served.
git
url
- url of your git repobranch
- the branch that should be used
response format
[[get]]
uri = "readme"
file = "README.md"
This will respond with the README.md
to GET
to readme
.
Note that readme
!= /readme
since /
implies root.
Supported file types
Sserver is able to serve any of the following file types:
- markdown
- html
- css
- jpg, png, ico
- raw text
- any executable file - stdout is returned as html
Ports
Run with -p <port_number>
to run Sserver on specific port (8000 is the default).
Dependencies
~18MB
~346K SLoC