mirror of
https://github.com/Noratrieb/icefun.git
synced 2026-01-14 21:05:00 +01:00
Construct minimum viable compiler ICE
This commit is contained in:
commit
e3064f6a97
5 changed files with 789 additions and 0 deletions
18
src/main.rs
Normal file
18
src/main.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
use std::convert::Infallible;
|
||||
use std::future::Future;
|
||||
use std::net::SocketAddr;
|
||||
|
||||
use futures::{future, FutureExt};
|
||||
use hyper::service::make_service_fn;
|
||||
use warp::Filter;
|
||||
|
||||
fn main() {
|
||||
let svc = warp::service(
|
||||
warp::path::end()
|
||||
.map(|| "Hello, world")
|
||||
.with(warp::trace::request()),
|
||||
);
|
||||
let make_svc = make_service_fn(move |_| future::ok::<_, Infallible>(svc.clone()));
|
||||
let addr = SocketAddr::from(([127, 0, 0, 1], 0));
|
||||
tokio::spawn(hyper::Server::bind(&addr).serve(make_svc));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue