Allow uploading images up to 32 MiB
This commit is contained in:
parent
74b0d25dfc
commit
929ebb84eb
1 changed files with 2 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
use axum::{
|
use axum::{
|
||||||
extract::{Multipart, State},
|
extract::{DefaultBodyLimit, Multipart, State},
|
||||||
http::StatusCode,
|
http::StatusCode,
|
||||||
routing::post,
|
routing::post,
|
||||||
Form, Router,
|
Form, Router,
|
||||||
|
|
@ -22,6 +22,7 @@ pub async fn run(tx: mpsc::Sender<Command>, addr: String) -> anyhow::Result<()>
|
||||||
.route("/text", post(post_text))
|
.route("/text", post(post_text))
|
||||||
.route("/image", post(post_image))
|
.route("/image", post(post_image))
|
||||||
.route("/chat_message", post(post_chat_message))
|
.route("/chat_message", post(post_chat_message))
|
||||||
|
.layer(DefaultBodyLimit::max(32 * 1024 * 1024)) // 32 MiB
|
||||||
.with_state(Server { tx });
|
.with_state(Server { tx });
|
||||||
|
|
||||||
let listener = TcpListener::bind(addr).await?;
|
let listener = TcpListener::bind(addr).await?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue