@aeriajs/server 0.0.270 → 0.0.272
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/dist/init.js +5 -4
- package/dist/init.mjs +6 -5
- package/dist/routes.d.ts +2 -2
- package/package.json +9 -9
package/dist/init.js
CHANGED
|
@@ -71,6 +71,9 @@ const init = (_options = {}) => {
|
|
|
71
71
|
return {
|
|
72
72
|
options,
|
|
73
73
|
listen: async () => {
|
|
74
|
+
if (!options.config.server) {
|
|
75
|
+
throw new Error;
|
|
76
|
+
}
|
|
74
77
|
const parentContext = await (0, core_1.createContext)({
|
|
75
78
|
config: options.config,
|
|
76
79
|
});
|
|
@@ -93,8 +96,6 @@ const init = (_options = {}) => {
|
|
|
93
96
|
const context = await (0, core_1.createContext)({
|
|
94
97
|
parentContext,
|
|
95
98
|
token,
|
|
96
|
-
});
|
|
97
|
-
Object.assign(context, {
|
|
98
99
|
request,
|
|
99
100
|
response,
|
|
100
101
|
});
|
|
@@ -105,12 +106,12 @@ const init = (_options = {}) => {
|
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
108
|
if (options.router) {
|
|
108
|
-
const result = await options.router.
|
|
109
|
+
const result = await options.router.handle(request, response, context);
|
|
109
110
|
if (result !== undefined) {
|
|
110
111
|
return result;
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
|
-
return apiRouter.
|
|
114
|
+
return apiRouter.handle(request, response, context);
|
|
114
115
|
});
|
|
115
116
|
});
|
|
116
117
|
if (!options.config.database?.noDatabase) {
|
package/dist/init.mjs
CHANGED
|
@@ -65,6 +65,9 @@ export const init = (_options = {}) => {
|
|
|
65
65
|
return {
|
|
66
66
|
options,
|
|
67
67
|
listen: async () => {
|
|
68
|
+
if (!options.config.server) {
|
|
69
|
+
throw new Error();
|
|
70
|
+
}
|
|
68
71
|
const parentContext = await createContext({
|
|
69
72
|
config: options.config
|
|
70
73
|
});
|
|
@@ -86,9 +89,7 @@ export const init = (_options = {}) => {
|
|
|
86
89
|
}
|
|
87
90
|
const context = await createContext({
|
|
88
91
|
parentContext,
|
|
89
|
-
token
|
|
90
|
-
});
|
|
91
|
-
Object.assign(context, {
|
|
92
|
+
token,
|
|
92
93
|
request,
|
|
93
94
|
response
|
|
94
95
|
});
|
|
@@ -99,12 +100,12 @@ export const init = (_options = {}) => {
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
if (options.router) {
|
|
102
|
-
const result = await options.router.
|
|
103
|
+
const result = await options.router.handle(request, response, context);
|
|
103
104
|
if (result !== void 0) {
|
|
104
105
|
return result;
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
|
-
return apiRouter.
|
|
108
|
+
return apiRouter.handle(request, response, context);
|
|
108
109
|
});
|
|
109
110
|
});
|
|
110
111
|
if (!options.config.database?.noDatabase) {
|
package/dist/routes.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export declare const registerRoutes: () => import("@aeriajs/http").ProxiedRouter
|
|
|
15
15
|
routes: ((_: unknown, context: RouteContext, groupOptions?: import("@aeriajs/http").RouteGroupOptions) => unknown)[];
|
|
16
16
|
routesMeta: import("@aeriajs/http").RoutesMeta;
|
|
17
17
|
group: <TRouter extends {
|
|
18
|
-
|
|
18
|
+
handle: (request: import("@aeriajs/types").GenericRequest, response: import("@aeriajs/types").GenericResponse, context: RouteContext, options?: import("@aeriajs/http").RouterOptions) => unknown;
|
|
19
19
|
routesMeta: import("@aeriajs/http").RoutesMeta;
|
|
20
20
|
}>(exp: import("@aeriajs/types").RouteUri, router: TRouter, middleware?: (context: RouteContext) => unknown) => void;
|
|
21
|
-
|
|
21
|
+
handle: (request: import("@aeriajs/types").GenericRequest, response: import("@aeriajs/types").GenericResponse, context: RouteContext, options?: import("@aeriajs/http").RouterOptions) => Promise<unknown>;
|
|
22
22
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.272",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"mongodb": "^6.17.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@aeriajs/core": "^0.0.
|
|
37
|
-
"@aeriajs/builtins": "^0.0.
|
|
38
|
-
"@aeriajs/common": "^0.0.
|
|
39
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
40
|
-
"@aeriajs/http": "^0.0.
|
|
41
|
-
"@aeriajs/node-http": "^0.0.
|
|
42
|
-
"@aeriajs/server": "^0.0.
|
|
43
|
-
"@aeriajs/types": "^0.0.
|
|
36
|
+
"@aeriajs/core": "^0.0.270",
|
|
37
|
+
"@aeriajs/builtins": "^0.0.270",
|
|
38
|
+
"@aeriajs/common": "^0.0.152",
|
|
39
|
+
"@aeriajs/entrypoint": "^0.0.158",
|
|
40
|
+
"@aeriajs/http": "^0.0.186",
|
|
41
|
+
"@aeriajs/node-http": "^0.0.186",
|
|
42
|
+
"@aeriajs/server": "^0.0.272",
|
|
43
|
+
"@aeriajs/types": "^0.0.130",
|
|
44
44
|
"mongodb": "^6.17.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|