Created
March 2, 2019 14:07
-
-
Save mike820324/524a003bf26eb8431b4a73ef1a483bdb to your computer and use it in GitHub Desktop.
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
| #![feature(proc_macro_hygiene, decl_macro)] | |
| #[macro_use] | |
| extern crate rocket; | |
| #[macro_use] | |
| extern crate rocket_contrib; | |
| #[macro_use] | |
| extern crate serde_derive; | |
| #[post("/register")] | |
| fn register() -> &'static str { | |
| "Register" | |
| } | |
| #[post("/login")] | |
| fn login() -> &'static str { | |
| "Login" | |
| } | |
| #[post("/logout")] | |
| fn logout() -> &'static str { | |
| "Logout" | |
| } | |
| fn main() { | |
| let mut rocket = rocket::ignite(); | |
| rocket = rocket.mount("/api/v1/auth", routes![register, login, logout]); | |
| rocket.launch(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment