GUI-STUDIO commited on
Commit
0deb3e9
·
1 Parent(s): 2b08713
Files changed (1) hide show
  1. src/index.ts +16 -11
src/index.ts CHANGED
@@ -1,10 +1,10 @@
1
  import { Elysia, Context, t } from "elysia";
2
  import { logger } from "@chneau/elysia-logger";
 
3
  import { cors } from "@elysiajs/cors";
4
- import {
5
- NS_helpers_client,
6
- NS_helpers_server
7
- } from "../../../../packages/lib/helpers/index";
8
 
9
  const APP_ENV = Bun.env.APP_ENV;
10
  const APP_ORIGIN = Bun.env.APP_ORIGIN;
@@ -21,7 +21,7 @@ const app = new Elysia()
21
  )
22
 
23
  .derive((ctx: any) => ({
24
- publicOrigin: NS_helpers_server.NS_routes.elysia.F_public_origin(ctx)
25
  }))
26
 
27
  .use(logger())
@@ -35,14 +35,16 @@ const app = new Elysia()
35
  } catch (err) {}
36
  }
37
 
38
- const err_d = NS_helpers_client.NS_error.F_collect_error_status_n_message({
39
  ERR: error
40
  });
41
 
42
- if (APP_ENV === "dev") {
43
- console.log("\n");
44
- console.log({ code, e_message, ...err_d }, "\n");
45
- }
 
 
46
 
47
  return new Response(error.toString(), {
48
  status: err_d.status,
@@ -53,7 +55,10 @@ const app = new Elysia()
53
  });
54
  })
55
 
56
- .get("/", () => "Hello Elysia")
 
 
 
57
  .listen(7860);
58
 
59
  console.log(
 
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";
7
+ import { NS_routes_elysia } from "../../../../packages/lib/helpers/server/routes-elysia";
 
8
 
9
  const APP_ENV = Bun.env.APP_ENV;
10
  const APP_ORIGIN = Bun.env.APP_ORIGIN;
 
21
  )
22
 
23
  .derive((ctx: any) => ({
24
+ publicOrigin: NS_routes_elysia.F_public_origin(ctx)
25
  }))
26
 
27
  .use(logger())
 
35
  } catch (err) {}
36
  }
37
 
38
+ const err_d = NS_error.F_collect_error_status_n_message({
39
  ERR: error
40
  });
41
 
42
+ NS_Misc.console.error({ ENV: "dev", _browser: false, _log: ["\n"] });
43
+ NS_Misc.console.error({
44
+ ENV: "dev",
45
+ _browser: false,
46
+ _log: [{ code, e_message, ...err_d }, "\n"]
47
+ });
48
 
49
  return new Response(error.toString(), {
50
  status: err_d.status,
 
55
  });
56
  })
57
 
58
+ .get("/", () => {
59
+ return "🦊 Hello Rafiki 🍿";
60
+ })
61
+
62
  .listen(7860);
63
 
64
  console.log(