Created
March 11, 2020 23:51
-
-
Save itslukej/6ecad11e47b09411c31017f314c8611b 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
| use warp::Filter; | |
| use dotenv::dotenv; | |
| use std::env; | |
| #[tokio::main] | |
| async fn main() { | |
| dotenv().ok(); | |
| let port = env::var("PORT") | |
| .expect("Port not found") | |
| .parse() | |
| .unwrap(); | |
| let pp = warp::path("penis") | |
| .and(warp::path::param()) | |
| .map(|uid: f64| { | |
| let size = /* PROPRIETARY ALGORITHM */; | |
| let rounded = size.round(); | |
| return format!("{}", rounded); | |
| }); | |
| println!("Listening on {}", &port); | |
| warp::serve(pp) | |
| .run(([0, 0, 0, 0], port)) | |
| .await; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment