update endpoints
This commit is contained in:
@@ -1,6 +1,12 @@
|
|||||||
|
const isDebug = import.meta.env.VITE_IS_DEBUG === "true";
|
||||||
|
|
||||||
export const pixelSize = 10;
|
export const pixelSize = 10;
|
||||||
export const pixelCooldown = 10 * 1000; // 10 seconds
|
export const pixelCooldown = 10 * 1000; // 10 seconds
|
||||||
export const canvasEndpoint = "http://localhost:3000/canvas/";
|
export const canvasEndpoint = isDebug
|
||||||
export const checkEndpoint = "http://localhost:3000/check/";
|
? "http://localhost:3000/canvas/"
|
||||||
|
: "/canvas/";
|
||||||
|
export const checkEndpoint = isDebug
|
||||||
|
? "http://localhost:3000/check/"
|
||||||
|
: "/check/";
|
||||||
export const WIDTH = 500;
|
export const WIDTH = 500;
|
||||||
export const HEIGHT = 500;
|
export const HEIGHT = 500;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use std::{
|
|||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
};
|
};
|
||||||
|
|
||||||
use axum::{routing::get, Extension, Json, Router, ServiceExt};
|
use axum::{routing::get, Extension, Json, Router};
|
||||||
use chrono::{DateTime, Duration, Utc};
|
use chrono::{DateTime, Duration, Utc};
|
||||||
use memory_stats::memory_stats;
|
use memory_stats::memory_stats;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@@ -13,10 +13,7 @@ use socketioxide::{
|
|||||||
extract::{Bin, Data, SocketRef},
|
extract::{Bin, Data, SocketRef},
|
||||||
SocketIo,
|
SocketIo,
|
||||||
};
|
};
|
||||||
use tower_governor::{
|
use tower_governor::{governor::GovernorConfigBuilder, GovernorLayer};
|
||||||
governor::{GovernorConfig, GovernorConfigBuilder},
|
|
||||||
GovernorLayer,
|
|
||||||
};
|
|
||||||
use tower_http::{
|
use tower_http::{
|
||||||
cors::{Any, CorsLayer},
|
cors::{Any, CorsLayer},
|
||||||
services::ServeDir,
|
services::ServeDir,
|
||||||
@@ -158,7 +155,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
let rate_governor = Arc::new(
|
let rate_governor = Arc::new(
|
||||||
GovernorConfigBuilder::default()
|
GovernorConfigBuilder::default()
|
||||||
.burst_size(6)
|
.burst_size(10)
|
||||||
.per_second(10)
|
.per_second(10)
|
||||||
.finish()
|
.finish()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
|
|||||||
Reference in New Issue
Block a user