@dnax/core 0.6.5 → 0.7.1
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/app/hono.ts +17 -0
- package/app/index.ts +4 -3
- package/package.json +1 -1
- package/types/index.ts +2 -0
package/app/hono.ts
CHANGED
|
@@ -111,6 +111,23 @@ function HonoInstance(): typeof app {
|
|
|
111
111
|
cors({
|
|
112
112
|
origin: Cfg.server?.cors?.origin || [],
|
|
113
113
|
credentials: Cfg.server?.cors?.credentials || true,
|
|
114
|
+
allowMethods: Cfg.server?.cors?.allowMethods || [
|
|
115
|
+
"GET",
|
|
116
|
+
"POST",
|
|
117
|
+
"PUT",
|
|
118
|
+
"DELETE",
|
|
119
|
+
"OPTIONS",
|
|
120
|
+
],
|
|
121
|
+
allowHeaders: Cfg.server?.cors?.allowHeaders || [
|
|
122
|
+
"Tenant-Id",
|
|
123
|
+
"Content-Type",
|
|
124
|
+
"Authorization",
|
|
125
|
+
"Accept",
|
|
126
|
+
"Origin",
|
|
127
|
+
"X-Requested-With",
|
|
128
|
+
"Access-Control-Request-Method",
|
|
129
|
+
"Access-Control-Request-Headers",
|
|
130
|
+
],
|
|
114
131
|
})
|
|
115
132
|
);
|
|
116
133
|
//eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoibm9tIiwiaWF0IjoxNzE3Nzc0MDQzLCJleHAiOjE3MTc3NzQxMDN9.Ud4-0y8pa4SMIcSn8PU1A-sjC-hT4ZVe_u3AdChyIJU
|
package/app/index.ts
CHANGED
|
@@ -18,10 +18,8 @@ type configRunApp = {
|
|
|
18
18
|
};
|
|
19
19
|
async function runApp(config?: configRunApp, clb?: Function) {
|
|
20
20
|
hookDatabase.cb = config?.dbSync || [];
|
|
21
|
-
// Load all ressouce
|
|
22
|
-
await init();
|
|
23
21
|
await loadCfg(); // Load Config
|
|
24
|
-
|
|
22
|
+
|
|
25
23
|
const PORT = Cfg.server?.port || process.env?.PORT || 4000;
|
|
26
24
|
const PORT_SOCKET = Cfg.server?.socket?.port || 9000;
|
|
27
25
|
|
|
@@ -38,6 +36,9 @@ async function runApp(config?: configRunApp, clb?: Function) {
|
|
|
38
36
|
await findPort.isAvailable(PORT).then(async (available: boolean) => {
|
|
39
37
|
// Start App server
|
|
40
38
|
if (available) {
|
|
39
|
+
// Load all ressouce
|
|
40
|
+
await init();
|
|
41
|
+
const HonoApp = HonoInstance();
|
|
41
42
|
//BeforeStart
|
|
42
43
|
if (config?.beforeStart) {
|
|
43
44
|
for (const fn of config?.beforeStart) {
|
package/package.json
CHANGED