/api -> /form

API endpoints will be added later
This commit is contained in:
DarkCat09 2024-03-12 10:19:52 +04:00
parent 73454ac4c8
commit 49899b6f34
Signed by: DarkCat09
GPG key ID: 0A26CD5B3345D6E3
3 changed files with 5 additions and 5 deletions

View file

@ -2,7 +2,7 @@ use futures::{StreamExt, TryStreamExt};
use ntex::web::{self, Error, HttpResponse};
use ntex_multipart::Multipart;
#[web::post("/api/upload")]
#[web::post("/form/upload")]
async fn upload(mut payload: Multipart) -> Result<HttpResponse, Error> {
while let Ok(Some(mut field)) = payload.try_next().await {
println!("CT: {:?}", field.content_type());

View file

@ -1,7 +1,7 @@
use ntex::web::{self, App};
use ntex_files;
mod api;
mod form;
mod pages;
#[ntex::main]
@ -9,7 +9,7 @@ async fn main() -> std::io::Result<()> {
web::server(move || {
App::new()
.service(pages::index)
.service(api::upload)
.service(form::upload)
.service(ntex_files::Files::new("/static", "./static"))
})
.bind("127.0.0.1:3002")?