GUI-STUDIO commited on
Commit ·
698de32
1
Parent(s): 699186a
Initialize runtime env vars and improve media processing
Browse filesAdd `set_env_var_db()` initialization to app entry points to ensure environment variables are loaded from remote database on startup. Refactor env.runtime to support ID-based filtering and APP_ENV configuration merging. Enhance post-processing with picture quality detection for improved duration matching. Fix media detection logic in vidnest with fallbacks and optional chaining. Code cleanup and formatting improvements across scraper modules.
- src/index.ts +3 -2
src/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import { Elysia, Context, t } from "elysia";
|
| 2 |
import { logger } from "@chneau/elysia-logger";
|
| 3 |
-
import { staticPlugin } from "@elysiajs/static";
|
| 4 |
import { cors } from "@elysiajs/cors";
|
| 5 |
import { NS_Misc } from "../../../../packages/lib/helpers/client/misc";
|
| 6 |
import { NS_error } from "../../../../packages/lib/helpers/client/error";
|
|
@@ -8,6 +7,8 @@ import { NS_routes_elysia } from "../../../../packages/lib/helpers/server/routes
|
|
| 8 |
import { HonoRouter } from "./sub-router/hono.index";
|
| 9 |
import { NS_runtime } from "../../../../packages/lib/env.runtime";
|
| 10 |
|
|
|
|
|
|
|
| 11 |
const APP_ENV = process.env.APP_ENV;
|
| 12 |
const APP_ORIGIN = process.env.APP_ORIGIN;
|
| 13 |
const PORT = process.env.PORT;
|
|
@@ -64,7 +65,7 @@ const app = new Elysia()
|
|
| 64 |
return "🦊 Hello Rafiki 🍿";
|
| 65 |
})
|
| 66 |
|
| 67 |
-
.get("/foo", (ctx) => {
|
| 68 |
const REQ_headers = ctx?.request?.headers;
|
| 69 |
console.log("\n", "REQ_headers", REQ_headers, "\n");
|
| 70 |
return "🦊 Hello Rafiki 🍿";
|
|
|
|
| 1 |
import { Elysia, Context, t } from "elysia";
|
| 2 |
import { logger } from "@chneau/elysia-logger";
|
|
|
|
| 3 |
import { cors } from "@elysiajs/cors";
|
| 4 |
import { NS_Misc } from "../../../../packages/lib/helpers/client/misc";
|
| 5 |
import { NS_error } from "../../../../packages/lib/helpers/client/error";
|
|
|
|
| 7 |
import { HonoRouter } from "./sub-router/hono.index";
|
| 8 |
import { NS_runtime } from "../../../../packages/lib/env.runtime";
|
| 9 |
|
| 10 |
+
await NS_runtime.set_env_var_db();
|
| 11 |
+
|
| 12 |
const APP_ENV = process.env.APP_ENV;
|
| 13 |
const APP_ORIGIN = process.env.APP_ORIGIN;
|
| 14 |
const PORT = process.env.PORT;
|
|
|
|
| 65 |
return "🦊 Hello Rafiki 🍿";
|
| 66 |
})
|
| 67 |
|
| 68 |
+
.get("/foo", (ctx: Context) => {
|
| 69 |
const REQ_headers = ctx?.request?.headers;
|
| 70 |
console.log("\n", "REQ_headers", REQ_headers, "\n");
|
| 71 |
return "🦊 Hello Rafiki 🍿";
|