Skip to content

Commit

Permalink
[WIP]:
Browse files Browse the repository at this point in the history
  • Loading branch information
williamboman committed Jun 19, 2024
1 parent 736d0a0 commit e7eabe6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion api/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use mason_registry_api::setup_tracing;
use vercel_runtime::{run, bundled_api, Error};
use vercel_runtime::{bundled_api, run, Body, Error, Request, Response};

#[tokio::main]
async fn main() -> Result<(), Error> {
Expand Down
10 changes: 2 additions & 8 deletions api/openvsx/[namespace]/[extension]/versions/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use mason_registry_api::{
vercel::parse_url,
QueryParams,
};
use vercel_runtime::{run, Body, Error, Request, Response};
use vercel_runtime::{Body, Error, Request, Response};

async fn handler(request: Request) -> Result<Response<Body>, Error> {
pub async fn handler(request: Request) -> Result<Response<Body>, Error> {
if request.method() != Method::GET {
return Ok(Response::builder()
.status(StatusCode::METHOD_NOT_ALLOWED)
Expand All @@ -26,9 +26,3 @@ async fn handler(request: Request) -> Result<Response<Body>, Error> {
Err(err) => mason_registry_api::vercel::err_json(err),
}
}

#[tokio::main]
async fn main() -> Result<(), Error> {
mason_registry_api::setup_tracing();
run(handler).await
}
10 changes: 2 additions & 8 deletions api/openvsx/[namespace]/[extension]/versions/latest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use mason_registry_api::{
vercel::parse_url,
QueryParams,
};
use vercel_runtime::{run, Body, Error, Request, Response};
use vercel_runtime::{Body, Error, Request, Response};

async fn handler(request: Request) -> Result<Response<Body>, Error> {
pub async fn handler(request: Request) -> Result<Response<Body>, Error> {
if request.method() != Method::GET {
return Ok(Response::builder()
.status(StatusCode::METHOD_NOT_ALLOWED)
Expand All @@ -26,9 +26,3 @@ async fn handler(request: Request) -> Result<Response<Body>, Error> {
Err(err) => mason_registry_api::vercel::err_json(err),
}
}

#[tokio::main]
async fn main() -> Result<(), Error> {
mason_registry_api::setup_tracing();
run(handler).await
}
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"ignoreCommand": "[ \"$VERCEL_ENV\" != production ]",
"functions": {
"api/main.rs": {
"runtime": "[email protected].1"
"runtime": "[email protected].7"
}
},
"rewrites": [
Expand Down

0 comments on commit e7eabe6

Please sign in to comment.