Skip to content

Commit

Permalink
Added example web serde for db
Browse files Browse the repository at this point in the history
  • Loading branch information
katyo committed Sep 18, 2018
1 parent 89084de commit 6a7875c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ledb-actix/examples/server.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
extern crate ledb_actix;
extern crate actix;
extern crate actix_web;

use ledb_actix::{Storage, storage};
use actix::{System};
use actix_web::{App, server};

fn main() {
System::run(|| {
let addr = Storage::new("database")
.unwrap()
.start(4);

server::new(move || App::with_state(addr.clone())
.scope("/", storage))
.bind("127.0.0.1:8888")
.unwrap()
.start();
});
}

0 comments on commit 6a7875c

Please sign in to comment.