Automatically create uploads directory
This commit is contained in:
parent
df367d53c7
commit
2e25aee255
1 changed files with 4 additions and 1 deletions
|
@ -4,7 +4,7 @@ use axum::{
|
||||||
};
|
};
|
||||||
use log::info;
|
use log::info;
|
||||||
use sqlx::postgres::PgPoolOptions;
|
use sqlx::postgres::PgPoolOptions;
|
||||||
use std::sync::Arc;
|
use std::{fs, sync::Arc};
|
||||||
use tokio::signal;
|
use tokio::signal;
|
||||||
use tower_http::services::ServeDir;
|
use tower_http::services::ServeDir;
|
||||||
|
|
||||||
|
@ -20,6 +20,9 @@ mod web;
|
||||||
async fn main() {
|
async fn main() {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|
||||||
|
let images_dir = CONFIG.uploads_dir.join("images");
|
||||||
|
fs::create_dir_all(images_dir).unwrap();
|
||||||
|
|
||||||
let pool = PgPoolOptions::new()
|
let pool = PgPoolOptions::new()
|
||||||
.max_connections(CONFIG.database.max_connections)
|
.max_connections(CONFIG.database.max_connections)
|
||||||
.connect(&CONFIG.database.url)
|
.connect(&CONFIG.database.url)
|
||||||
|
|
Loading…
Reference in a new issue