sserver

Crates.iosserver
lib.rssserver
version1.0.3
sourcesrc
created_at2020-03-17 19:31:04.387323
updated_at2020-09-16 13:09:39.593056
descriptionserve your repositories as webpages
homepage
repositoryhttps://github.com/Dawidkubis/sserver
max_upload_size
id219923
size37,740
(Dawidkubis)

documentation

README

Sserver

To Do

  • remove settings.toml
  • more templates

Dependencies

  • git
  • rust - nightly version
  • make - 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 url
  • skeleton - a skeleton html file, required for markdown generation
  • response - 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 repo
  • branch - 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).

Commit count: 0

cargo fmt