Skip to content

Commit

Permalink
Print logo
Browse files Browse the repository at this point in the history
  • Loading branch information
jidoc01 committed Jul 10, 2023
1 parent 0862c87 commit 321f131
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
6 changes: 4 additions & 2 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[package]
name = "server"
version = "0.0.1"
name = "RustyDO"
version = "0.1.0"
authors = ["JungHyun Kim <jidoc01@gmail.com>"]
readme = "README.md"
repository = "https://github.com/jidoc01/RustyDO"
edition = "2021"

[dependencies]
Expand Down
20 changes: 18 additions & 2 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,32 @@ extern crate anyhow;

use crate::prelude::*;

const VERSION: &str = env!("CARGO_PKG_VERSION");
const AUTHORS: &str = env!("CARGO_PKG_AUTHORS");
const REPOSITORY: &str = env!("CARGO_PKG_REPOSITORY");
const LOGO: &str = r"
_____ _ _____ ____
| __ \ | | | __ \ / __ \
| |__) | _ ___| |_ _ _| | | | | | |
| _ / | | / __| __| | | | | | | | | |
| | \ \ |_| \__ \ |_| |_| | |__| | |__| |
|_| \_\__,_|___/\__|\__, |_____/ \____/
__/ |
|___/ ";

#[tokio::main]
async fn main() -> Result<()> {
println!("{LOGO}");
println!("RustyDO v{VERSION}");
println!("Repository: {REPOSITORY}");
println!("Contact: {AUTHORS}");
let config = Config::open(CONFIG_PATH)?;
let db = Connection::open(DB_PATH)?;
db.table(USER_TBL)?;
db.table(POST_TBL)?;
let mut login = login::Server::new(config.clone(), db);
let login_tx = login.get_server_tx();

status::run(config, login_tx).await;
login.run().await; // Note that it will block the thread.
Ok(())
}
}

0 comments on commit 321f131

Please sign in to comment.