Last active
July 28, 2021 01:02
-
-
Save wijiler/23b4d45056f5ef46b813fa8fb7440ba1 to your computer and use it in GitHub Desktop.
server in https://rocket.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[macro_use] extern crate rocket; | |
| use rocket::Request; | |
| #[get("/")] | |
| fn insertfunctionnamehere() -> &'static str { | |
| "Insert words here" | |
| } | |
| #[catch(404)] | |
| fn not_found(req: &Request) -> String { | |
| format!("404 could not find '{}' did ya mistype that?", req.uri()) | |
| } | |
| #[launch] | |
| rocket::build().mount("/", routes![index]) | |
| .register("/", catchers![not_found]) | |
| /* for multipage do the same thing with the #[get("/")] macro (including the same "/") and have a | |
| function with a different name and do .mount("/insertnameofpagehere", routes[functionname]) | |
| and then you should have a multi page website*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment