diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-01-01 16:32:55 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-01-01 16:32:55 +0100 |
commit | bdb77f97d6af5a59e80d2b2552cd6994754cbf29 (patch) | |
tree | 20bbc02edfe21f2dd75985976e273a97c809bb07 /planetwars-server/src/routes/bots.rs | |
parent | 4a077c7c65eced447c45389acf05007dd571bf26 (diff) | |
download | planetwars.dev-bdb77f97d6af5a59e80d2b2552cd6994754cbf29.tar.xz planetwars.dev-bdb77f97d6af5a59e80d2b2552cd6994754cbf29.zip |
minimal port of start_match logic
Diffstat (limited to 'planetwars-server/src/routes/bots.rs')
-rw-r--r-- | planetwars-server/src/routes/bots.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/planetwars-server/src/routes/bots.rs b/planetwars-server/src/routes/bots.rs index 8327443..5f5d8f5 100644 --- a/planetwars-server/src/routes/bots.rs +++ b/planetwars-server/src/routes/bots.rs @@ -1,22 +1,18 @@ -use axum::extract::{Multipart, Path, RawBody}; +use axum::extract::{Multipart, Path}; use axum::http::StatusCode; -use axum::response::IntoResponse; use axum::Json; use rand::distributions::Alphanumeric; use rand::Rng; use serde::{Deserialize, Serialize}; use serde_json::{json, value::Value as JsonValue}; use std::io::Cursor; -use std::path::{self, PathBuf}; +use std::path::PathBuf; use crate::db::bots::{self, CodeBundle}; use crate::db::users::User; -use crate::DatabaseConnection; +use crate::{DatabaseConnection, BOTS_DIR}; use bots::Bot; -// TODO: make this a parameter -const BOTS_DIR: &str = "./data/bots"; - #[derive(Serialize, Deserialize, Debug)] pub struct BotParams { name: String, |