feat: add basic HTTP, websocket functionality
- add ntex and serde as requirements - add HTTP server with index/ and ws/ endpoints - add websocket types and systems, basic Ping and GetTracks endpoints - add serialize/deserialize support to models::Tracks - add handle and get_tracks method to library - clean up types.rs
This commit is contained in:
@@ -10,10 +10,11 @@ use std::env;
|
||||
|
||||
mod library;
|
||||
mod models;
|
||||
mod net;
|
||||
mod schema;
|
||||
mod types;
|
||||
|
||||
use library::{Importer, Library};
|
||||
use library::{Handle, Importer, Library};
|
||||
|
||||
fn open_db_file() -> SqliteConnection {
|
||||
let database_url = env::var("DATABASE_URL").expect("DATABASE_URL missing");
|
||||
@@ -47,4 +48,8 @@ fn main() {
|
||||
.expect("Error importing files");
|
||||
|
||||
library_instance.print().expect("Error printing library");
|
||||
|
||||
let library_handle = Handle::new(library_instance);
|
||||
|
||||
net::http::start(library_handle).expect("HTTP server failed to start");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user