Skip to content

Commit

Permalink
Replace civet with conduit-hyper
Browse files Browse the repository at this point in the history
  • Loading branch information
jtgeibel committed May 1, 2018
1 parent 802d105 commit 7b75849
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 32 deletions.
43 changes: 20 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ conduit-middleware = "0.8"
conduit-router = "0.8"
conduit-static = "0.8"
conduit-git-http-backend = "0.8"
civet = "0.9"
conduit-hyper = { git = "https://github.com/jtgeibel/conduit-hyper", branch = "stable-1.26" }

[dev-dependencies]
conduit-test = "0.8"
Expand Down
13 changes: 5 additions & 8 deletions src/bin/server.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#![deny(warnings)]

extern crate cargo_registry;
extern crate civet;
extern crate conduit_hyper;
extern crate env_logger;
extern crate git2;

use cargo_registry::{env, Env};
use civet::Server;
use conduit_hyper::Server;
use std::env;
use std::fs::{self, File};
use std::sync::Arc;
use std::sync::mpsc::channel;

fn main() {
// Initialize logging
Expand Down Expand Up @@ -66,9 +65,8 @@ fn main() {
} else {
50
};
let mut cfg = civet::Config::new();
cfg.port(port).threads(threads).keep_alive(true);
let _a = Server::start(cfg, app);
let addr = ([127, 0, 0, 1], port).into();
let server = Server::http(addr, app, threads).unwrap();

println!("listening on port {}", port);

Expand All @@ -79,6 +77,5 @@ fn main() {
}

// TODO: handle a graceful shutdown by just waiting for a SIG{INT,TERM}
let (_tx, rx) = channel::<()>();
rx.recv().unwrap();
server.run().unwrap();
}

0 comments on commit 7b75849

Please sign in to comment.