Launching Rocket without codegen #1772
-
Are there any examples of manually starting a server, without code generators? I'd like to make an unified binary which accepts and parses command line arguments before deciding what to do. Starting a server is only one of the possible actions, so I need full control over the main function in order to figure out if user wants to start a server or do something else |
Beta Was this translation helpful? Give feedback.
Answered by
baptiste0928
Jul 20, 2021
Replies: 1 comment 8 replies
-
You can manually launch a Rocket instance with the #[rocket::main]
async fn main() {
rocket::build()
.mount("/hello", routes![world])
.launch()
.await;
} More information : https://rocket.rs/v0.5-rc/guide/overview/#launching |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
bubelov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can manually launch a Rocket instance with the
launch()
method :More information : https://rocket.rs/v0.5-rc/guide/overview/#launching