@ezetgalaxy/titan 25.14.4 → 25.14.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/server/src/main.rs +14 -6
package/package.json
CHANGED
|
@@ -10,6 +10,8 @@ use axum::{
|
|
|
10
10
|
Router,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
use std::path::Path;
|
|
14
|
+
|
|
13
15
|
use boa_engine::{
|
|
14
16
|
js_string,
|
|
15
17
|
native_function::NativeFunction,
|
|
@@ -36,8 +38,6 @@ struct RouteVal {
|
|
|
36
38
|
#[derive(Clone)]
|
|
37
39
|
struct AppState {
|
|
38
40
|
routes: Arc<HashMap<String, RouteVal>>,
|
|
39
|
-
/// Project root — used only in dev mode
|
|
40
|
-
project_root: PathBuf,
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
fn inject_t_fetch(ctx: &mut Context) {
|
|
@@ -189,7 +189,7 @@ async fn dynamic_handler(
|
|
|
189
189
|
.into_response();
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
let actions_dir = resolve_actions_dir(
|
|
192
|
+
let actions_dir = resolve_actions_dir();
|
|
193
193
|
let action_path = actions_dir.join(format!("{}.jsbundle", action_name));
|
|
194
194
|
|
|
195
195
|
if !action_path.exists() {
|
|
@@ -253,11 +253,10 @@ async fn main() -> Result<()> {
|
|
|
253
253
|
let routes_map: HashMap<String, RouteVal> =
|
|
254
254
|
serde_json::from_value(json["routes"].clone()).unwrap_or_default();
|
|
255
255
|
|
|
256
|
-
let
|
|
256
|
+
let _project_root = detect_project_root();
|
|
257
257
|
|
|
258
258
|
let state = AppState {
|
|
259
259
|
routes: Arc::new(routes_map),
|
|
260
|
-
project_root,
|
|
261
260
|
};
|
|
262
261
|
|
|
263
262
|
|
|
@@ -268,7 +267,16 @@ let state = AppState {
|
|
|
268
267
|
.with_state(state);
|
|
269
268
|
|
|
270
269
|
let listener = TcpListener::bind(format!("0.0.0.0:{}", port)).await?;
|
|
271
|
-
|
|
270
|
+
// TITAN BANNER
|
|
271
|
+
println!("\n\x1b[38;5;208m████████╗██╗████████╗ █████╗ ███╗ ██╗");
|
|
272
|
+
println!("╚══██╔══╝██║╚══██╔══╝██╔══██╗████╗ ██║");
|
|
273
|
+
println!(" ██║ ██║ ██║ ███████║██╔██╗ ██║");
|
|
274
|
+
println!(" ██║ ██║ ██║ ██╔══██║██║╚██╗██║");
|
|
275
|
+
println!(" ██║ ██║ ██║ ██║ ██║██║ ╚████║");
|
|
276
|
+
println!(" ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝\x1b[0m\n");
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
println!("\x1b[38;5;39mTitan server running at:\x1b[0m http://localhost:{}", port);
|
|
272
280
|
|
|
273
281
|
axum::serve(listener, app).await?;
|
|
274
282
|
Ok(())
|