Skip to content

Commit 7b75849

Browse files
committed
Replace civet with conduit-hyper
1 parent 802d105 commit 7b75849

File tree

3 files changed

+26
-32
lines changed

3 files changed

+26
-32
lines changed

Cargo.lock

Lines changed: 20 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ conduit-middleware = "0.8"
6868
conduit-router = "0.8"
6969
conduit-static = "0.8"
7070
conduit-git-http-backend = "0.8"
71-
civet = "0.9"
71+
conduit-hyper = { git = "https://github.com/jtgeibel/conduit-hyper", branch = "stable-1.26" }
7272

7373
[dev-dependencies]
7474
conduit-test = "0.8"

src/bin/server.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
#![deny(warnings)]
22

33
extern crate cargo_registry;
4-
extern crate civet;
4+
extern crate conduit_hyper;
55
extern crate env_logger;
66
extern crate git2;
77

88
use cargo_registry::{env, Env};
9-
use civet::Server;
9+
use conduit_hyper::Server;
1010
use std::env;
1111
use std::fs::{self, File};
1212
use std::sync::Arc;
13-
use std::sync::mpsc::channel;
1413

1514
fn main() {
1615
// Initialize logging
@@ -66,9 +65,8 @@ fn main() {
6665
} else {
6766
50
6867
};
69-
let mut cfg = civet::Config::new();
70-
cfg.port(port).threads(threads).keep_alive(true);
71-
let _a = Server::start(cfg, app);
68+
let addr = ([127, 0, 0, 1], port).into();
69+
let server = Server::http(addr, app, threads).unwrap();
7270

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

@@ -79,6 +77,5 @@ fn main() {
7977
}
8078

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

0 commit comments

Comments
 (0)