mirror of
https://github.com/mikedilger/chorus.git
synced 2026-02-02 06:25:12 +00:00
Listen
This commit is contained in:
parent
859d6e9edf
commit
c315ed671f
@ -13,6 +13,7 @@ use crate::store::Store;
|
||||
use std::env;
|
||||
use std::fs::OpenOptions;
|
||||
use std::io::Read;
|
||||
use tokio::net::TcpListener;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Error> {
|
||||
@ -37,6 +38,10 @@ async fn main() -> Result<(), Error> {
|
||||
let store = Store::new(&config.data_directory)?;
|
||||
let _ = GLOBALS.store.set(store);
|
||||
|
||||
// Bind listener to port
|
||||
let _listener = TcpListener::bind((&*config.ip_address, config.port)).await?;
|
||||
log::info!("Running on {}:{}", config.ip_address, config.port);
|
||||
|
||||
// Store config into GLOBALS
|
||||
*GLOBALS.config.write().await = config;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user