Skip to content

Commit

Permalink
Merge pull request #23 from wbcsd/martin/drop-lambda-feature
Browse files Browse the repository at this point in the history
chore: remove lamdba_web crate since we no longer deploy this on AWS Lambda
  • Loading branch information
zeitgeist authored Apr 2, 2024
2 parents a6b64ab + af8ed8f commit 28524df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 140 deletions.
120 changes: 1 addition & 119 deletions endpoint/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions endpoint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,5 @@ base64 = "0.13"
url = { version = "2.4.1", features = ["serde"] }
rsa = { version = "0.9.2", features = ["pem", "sha2"] }
rand = "0.8.5"

[dependencies.lambda-web]
version = "0.1.8"
features = ["rocket05"]

[dependencies.rocket]
version = "0.5.0-rc.1"
features = ["json"]

[dependencies.uuid]
version = "1.8"
features = ["v4", "serde"]
uuid = { version = "1.8", features = ["v4", "serde"] }
rocket = { version = "0.5.0-rc.1", features = ["json"] }
12 changes: 3 additions & 9 deletions endpoint/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ use jsonwebtoken::jwk::{
AlgorithmParameters, CommonParameters, Jwk, JwkSet, KeyAlgorithm, PublicKeyUse,
RSAKeyParameters,
};
use lambda_web::{is_running_on_lambda, launch_rocket_on_lambda, LambdaError};
use okapi::openapi3::{Object, Parameter, ParameterValue};
use rocket::form::Form;
use rocket::request::FromRequest;
use rocket::Error as RocketError;

use rocket::serde::json::Json;
use rocket::State;
Expand Down Expand Up @@ -494,15 +494,9 @@ fn create_server(key_pair: KeyPair) -> rocket::Rocket<rocket::Build> {
}

#[rocket::main]
async fn main() -> Result<(), LambdaError> {
async fn main() -> Result<(), RocketError> {
let rocket = create_server(load_keys());
if is_running_on_lambda() {
// Launch on AWS Lambda
launch_rocket_on_lambda(rocket).await?;
} else {
// Launch local server
let _ = rocket.launch().await?;
}
let _ = rocket.launch().await?;
Ok(())
}

Expand Down

0 comments on commit 28524df

Please sign in to comment.