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