change request from get to post

This commit is contained in:
2026-03-03 12:15:49 -05:00
parent 301a9d908a
commit 51b7d51ff2

View File

@@ -1,4 +1,4 @@
use axum::{Router, response::IntoResponse, routing::get}; use axum::{Router, response::IntoResponse, routing::{get, post}};
use reqwest::StatusCode; use reqwest::StatusCode;
use serde_json::json; use serde_json::json;
use std::env; use std::env;
@@ -6,8 +6,8 @@ use std::env;
// Define an asynchronous main function with the tokio runtime macro // Define an asynchronous main function with the tokio runtime macro
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
// Build our application with one route: a GET request to "/" // Build our application with one route: a POST request to "/"
let app = Router::new().route("/", get(trigger_runner)); let app = Router::new().route("/", post(trigger_runner));
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
axum::serve(listener, app).await.unwrap(); axum::serve(listener, app).await.unwrap();