made server and details statics/consts

This commit is contained in:
Mitch161 2020-07-19 21:05:09 +01:00
parent 0e6d141704
commit 700c093c6b
1 changed files with 14 additions and 8 deletions

View File

@ -1,17 +1,23 @@
#[macro_use]
extern crate lazy_static;
mod server;
// mod server_v2;
use crate::server::server_profile::Server;
fn main(){
let server_name: &'static str = "Server-01";
let server_address: &'static str = "0.0.0.0:6000";
let server_author: &'static str = "noreply@email.com";
fn main(){
lazy_static!{
static ref server_name: &'static str = "Server-01";
static ref server_address: &'static str = "0.0.0.0:6000";
static ref server_author: &'static str = "noreply@email.com";
static ref SERVER: Server<'static> = Server::new(&server_name, &server_address, &server_author);
}
/*
let server_name = String::from("Server-01");
let server_address = String::from("0.0.0.0:6000");
let server_owner = String::from("noreply@email.com");
let server_author = String::from("noreply@email.com");
*/
let server = Server::new(server_name, server_address, server_author);
//server.start();
//let server = Server::new(server_name, server_address, server_author);
SERVER.start();
}