update readme and config creating if does not exists
This commit is contained in:
parent
338991b9c1
commit
c30cf3fbe9
15
README.md
15
README.md
@ -11,20 +11,23 @@ Features:
|
||||
|
||||
Default `conf.yml`:
|
||||
```yml
|
||||
http_host: localhost:80
|
||||
https_host: localhost:443
|
||||
http_host: localhost:80 # Http server host
|
||||
https_host: localhost:443 # Https server host
|
||||
|
||||
sites:
|
||||
# - domain: example.com # Domain with SSL
|
||||
# host: localhost:8080
|
||||
# ssl_cert: "/path/to/public/certificate.txt"
|
||||
# ssl_key: "/path/to/private/key.txt"
|
||||
# host: localhost:8080 # Http server host
|
||||
# ssl_cert: "/path/to/public/certificate.txt" # Ssl public certificate file
|
||||
# ssl_key: "/path/to/private/key.txt" # Ssl private key file
|
||||
# support_keep_alive: true # Does server supports keep-alive connections
|
||||
|
||||
# - domain: sub.example.com # Domain with no SSL
|
||||
# host: localhost:8081
|
||||
# host: localhost:8081 # Http server host
|
||||
# support_keep_alive: true # Does server supports keep-alive connections
|
||||
|
||||
- domain: localhost
|
||||
host: localhost:8080
|
||||
support_keep_alive: false
|
||||
```
|
||||
|
||||
Rust features:
|
||||
|
16
conf.yml
16
conf.yml
@ -1,16 +1,16 @@
|
||||
http_host: localhost:80
|
||||
https_host: localhost:443
|
||||
http_host: localhost:80 # Http server host
|
||||
https_host: localhost:443 # Https server host
|
||||
|
||||
sites:
|
||||
# - domain: example.com # Domain with SSL
|
||||
# host: localhost:8080
|
||||
# ssl_cert: "/path/to/public/certificate.txt"
|
||||
# ssl_key: "/path/to/private/key.txt"
|
||||
# support_keep_alive: true
|
||||
# host: localhost:8080 # Http server host
|
||||
# ssl_cert: "/path/to/public/certificate.txt" # Ssl public certificate file
|
||||
# ssl_key: "/path/to/private/key.txt" # Ssl private key file
|
||||
# support_keep_alive: true # Does server supports keep-alive connections
|
||||
|
||||
# - domain: sub.example.com # Domain with no SSL
|
||||
# host: localhost:8081
|
||||
# support_keep_alive: true
|
||||
# host: localhost:8081 # Http server host
|
||||
# support_keep_alive: true # Does server supports keep-alive connections
|
||||
|
||||
- domain: localhost
|
||||
host: localhost:8080
|
||||
|
@ -1,8 +1,14 @@
|
||||
use std::{fs, path::Path};
|
||||
|
||||
use flowgate::{Config, FlowgateServer};
|
||||
|
||||
fn main() {
|
||||
colog::init();
|
||||
|
||||
if !Path::new("conf.yml").exists() {
|
||||
let _ = fs::write("conf.yml", include_bytes!("../conf.yml"));
|
||||
}
|
||||
|
||||
let config = Config::parse("conf.yml").unwrap();
|
||||
let server = FlowgateServer::new(config);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user