forked from Roflin/gamenight
Add PlatformUno Frontend.
This commit is contained in:
1053
backend-actix/Cargo.lock
generated
1053
backend-actix/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "4"
|
||||
actix-cors = "0.6"
|
||||
actix-cors = "0.7"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
uuid = { version = "1.3.0", features = ["serde", "v4"] }
|
||||
@@ -16,5 +16,6 @@ diesel-derive-enum = { version = "2.0", features = ["postgres"] }
|
||||
diesel_migrations = "2.0"
|
||||
argon2 = "0.5"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
jsonwebtoken = "8.1"
|
||||
validator = { version = "0.16", features = ["derive"] }
|
||||
jsonwebtoken = "9.3"
|
||||
validator = { version = "0.16", features = ["derive"] }
|
||||
env_logger = "0.11.5"
|
||||
@@ -3,6 +3,9 @@ pub mod schema;
|
||||
pub mod util;
|
||||
|
||||
use actix_cors::Cors;
|
||||
use actix_web::error;
|
||||
use actix_web::middleware::Logger;
|
||||
use actix_web::HttpResponse;
|
||||
use actix_web::HttpServer;
|
||||
use actix_web::App;
|
||||
use actix_web::http;
|
||||
@@ -35,6 +38,8 @@ async fn main() -> std::io::Result<()> {
|
||||
let mut conn = pool.get_conn();
|
||||
run_migration(&mut conn);
|
||||
|
||||
env_logger::init_from_env(env_logger::Env::new().default_filter_or("debug"));
|
||||
|
||||
HttpServer::new(move || {
|
||||
let cors = Cors::default()
|
||||
.allowed_origin("0.0.0.0")
|
||||
@@ -45,6 +50,15 @@ async fn main() -> std::io::Result<()> {
|
||||
.max_age(3600);
|
||||
|
||||
App::new()
|
||||
.app_data(web::JsonConfig::default().error_handler(|err, _req| {
|
||||
error::InternalError::from_response(
|
||||
"",
|
||||
HttpResponse::BadRequest()
|
||||
.content_type("application/json")
|
||||
.body(format!(r#"{{"error":"{}"}}"#, err)),
|
||||
).into()
|
||||
}))
|
||||
.wrap(Logger::default())
|
||||
.wrap(cors)
|
||||
.app_data(web::Data::new(pool.clone()))
|
||||
.service(login)
|
||||
|
||||
@@ -46,6 +46,7 @@ diesel::table! {
|
||||
diesel::table! {
|
||||
registration_tokens (id) {
|
||||
id -> Uuid,
|
||||
#[max_length = 32]
|
||||
token -> Bpchar,
|
||||
single_use -> Bool,
|
||||
expires -> Nullable<Timestamptz>,
|
||||
@@ -65,7 +66,9 @@ diesel::table! {
|
||||
}
|
||||
|
||||
diesel::joinable!(gamenight -> users (owner_id));
|
||||
diesel::joinable!(gamenight_gamelist -> gamenight (gamenight_id));
|
||||
diesel::joinable!(gamenight_gamelist -> known_games (game_id));
|
||||
diesel::joinable!(gamenight_participants -> gamenight (gamenight_id));
|
||||
diesel::joinable!(gamenight_participants -> users (user_id));
|
||||
diesel::joinable!(pwd -> users (user_id));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user