https://github.com/richardcarls/polyserve
https://github.com/richardcarls/polyserve
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/richardcarls/polyserve
- Owner: richardcarls
- License: apache-2.0
- Created: 2021-05-04T19:15:25.000Z (about 4 years ago)
- Default Branch: develop
- Last Pushed: 2022-06-12T01:30:41.000Z (almost 3 years ago)
- Last Synced: 2025-02-07T18:19:49.147Z (4 months ago)
- Language: Rust
- Size: 146 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# polyserve
[](https://github.com/clap-rs/clap/blob/master/LICENSE-APACHE)
[](https://github.com/clap-rs/clap/blob/master/LICENSE-MIT)
[](https://github.com/richardcarls/polyserve/graphs/contributors)Toy HTTP server built in Rust on top of [roa](https://github.com/Hexilee/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
```bash
polyserve -p 3000 ./some-http-root
```### Library
```toml
# Cargo.toml[dependencies]
polyserve = { git = "https://github.com/richardcarls/polyserve/" }
async-std = { version = "1.10.0", features = ["attributes"] }
``````rust,no_run
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
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)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.