/api -> /form
API endpoints will be added later
This commit is contained in:
parent
73454ac4c8
commit
49899b6f34
3 changed files with 5 additions and 5 deletions
|
@ -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());
|
|
@ -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")?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue