reuploading levels

This commit is contained in:
Reid 2023-09-20 18:46:37 -07:00
parent fd88a4e374
commit 4d8a41ba47
Signed by: reidlab
GPG key ID: 6C9EAA3364F962C8
20 changed files with 604 additions and 22 deletions

View file

@ -34,6 +34,10 @@ async fn files(file: PathBuf) -> Option<NamedFile> {
#[launch]
fn rocket() -> _ {
// init stuff
crate::helpers::reupload::init();
// data directories
// this is a bit scuffed
fs::create_dir_all(&CONFIG.db.data_folder).expect("failed to create data directory!");
fs::create_dir_all(format!("{}/levels", &CONFIG.db.data_folder)).expect("failed to create data directory for levels");
@ -46,13 +50,16 @@ fn rocket() -> _ {
.merge(("limits", Limits::new().limit("forms", 10.megabytes()))))
// actual website
.mount("/", routes![
template_endpoints::index::index
template_endpoints::index::index,
template_endpoints::reupload::post_reupload,
template_endpoints::reupload::get_reupload
])
// assets
.mount("/", routes![
files
])
// GEOMETRY DASH https://www.youtube.com/watch?v=_pLrtsf5yfE
// https://www.youtube.com/watch?v=_pLrtsf5yfE
.mount(CONFIG.general.append_path.as_str(), routes![
endpoints::accounts::login_account::login_account,
endpoints::accounts::register_account::register_account,