Skip to content

richardcarls/polyserve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

polyserve

License License Contributors

Toy HTTP server built in Rust on top of roa.

It's main objective is to support advanced web server features purely with accessible filesystem-based configuration. This will be accomplished through a cascading flat-file configuration and naming conventions.

Disclaimer

Don't actually use this for anything. Keep away from public-facing interfaces. The server listens on the loopback interface by default and is not configurable for this reason.

Overview

What can polyserve do?

  • Asynchronously serve files from the web root
  • TLS connections
  • Cascading configuration via .config.toml files (analogous to Apache's .htaccess)
  • Indexes and Auto-Index support
  • Extension elision and trailing slash redirects
  • Expose your system and all your secrets to the entire internet

What's next?

  • Handlebars rendering (WIP):
    • layout templates
    • content templates
    • partials
    • script helpers
  • Markdown rendering
  • Tests
  • Queryable cascading context data, file frontmatter (SQLite?)
  • Cache layer
  • Get fat and grow a big white beard
  • Implement cool stuff like federated login, ActivityPub, etc.

Installation

This project is not on crates.io yet! Clone this repo and build with rustc.

Usage

CLI

polyserve -p 3000 ./some-http-root

Library

# Cargo.toml

[dependencies]
polyserve = { git = "https://github.com/richardcarls/polyserve/" }
async-std = { version = "1.10.0", features = ["attributes"] }
use polyserve::App;

#[async_std::main]
fn main() {
    let app = App::default();

    app.listen("127.0.0.1:8080", "./some-http-root").await?;
}

Configuration

See include/default.toml for all options.

License

Licensed under either of

at your option.

Contribution

I am not looking for contributors at this time, but would love to hear feedback from anyone brave enough to use this.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published