mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2025-03-13 18:42:40 +00:00
Extract launch_rocket() from main() as public within crate scope
This commit is contained in:
parent
042a1fd2b0
commit
e12528aae4
1 changed files with 6 additions and 2 deletions
|
@ -60,7 +60,7 @@ fn init_pool() -> Option<DbPool> {
|
|||
Some(pool)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
pub(crate) fn init_rocket() -> rocket::Rocket {
|
||||
match dotenv::dotenv() {
|
||||
Ok(path) => eprintln!("Configuration read from {}", path.display()),
|
||||
Err(ref e) if e.not_found() => eprintln!("no .env was found"),
|
||||
|
@ -272,5 +272,9 @@ Then try to restart Plume.
|
|||
|
||||
#[cfg(feature = "test")]
|
||||
let rocket = rocket.mount("/test", routes![test_routes::health,]);
|
||||
rocket.launch();
|
||||
rocket
|
||||
}
|
||||
|
||||
fn main() {
|
||||
init_rocket().launch();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue