mikroserve 0.0.5 → 0.0.6
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/README.md +1 -1
- package/lib/MikroServe.js +4 -1
- package/lib/MikroServe.mjs +1 -1
- package/lib/{chunk-BUKLE4JV.mjs → chunk-E3RGQ7QF.mjs} +4 -1
- package/lib/index.js +4 -1
- package/lib/index.mjs +1 -1
- package/lib/interfaces/index.d.mts +1 -0
- package/lib/interfaces/index.d.ts +1 -0
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- Supports custom middlewares
|
|
14
14
|
- Out-of-the-box CORS support
|
|
15
15
|
- Built-in customizable rate limiter
|
|
16
|
-
- Tiny (~4.
|
|
16
|
+
- Tiny (~4.8kb gzipped)
|
|
17
17
|
- Only a single dependency: [MikroConf](https://github.com/mikaelvesavuori/mikroconf)
|
|
18
18
|
|
|
19
19
|
## Installation
|
package/lib/MikroServe.js
CHANGED
|
@@ -494,7 +494,10 @@ var MikroServe = class {
|
|
|
494
494
|
});
|
|
495
495
|
}
|
|
496
496
|
const result = await this.router.handle(req, res);
|
|
497
|
-
if (result)
|
|
497
|
+
if (result) {
|
|
498
|
+
if (result._handled) return;
|
|
499
|
+
return this.respond(res, result);
|
|
500
|
+
}
|
|
498
501
|
return this.respond(res, {
|
|
499
502
|
statusCode: 404,
|
|
500
503
|
body: {
|
package/lib/MikroServe.mjs
CHANGED
|
@@ -201,7 +201,10 @@ var MikroServe = class {
|
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
203
|
const result = await this.router.handle(req, res);
|
|
204
|
-
if (result)
|
|
204
|
+
if (result) {
|
|
205
|
+
if (result._handled) return;
|
|
206
|
+
return this.respond(res, result);
|
|
207
|
+
}
|
|
205
208
|
return this.respond(res, {
|
|
206
209
|
statusCode: 404,
|
|
207
210
|
body: {
|
package/lib/index.js
CHANGED
|
@@ -496,7 +496,10 @@ var MikroServe = class {
|
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
498
|
const result = await this.router.handle(req, res);
|
|
499
|
-
if (result)
|
|
499
|
+
if (result) {
|
|
500
|
+
if (result._handled) return;
|
|
501
|
+
return this.respond(res, result);
|
|
502
|
+
}
|
|
500
503
|
return this.respond(res, {
|
|
501
504
|
statusCode: 404,
|
|
502
505
|
body: {
|
package/lib/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mikroserve",
|
|
3
3
|
"description": "Minimalistic, ready-to-use API, built on Node.js primitives.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.6",
|
|
5
5
|
"author": "Mikael Vesavuori",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"keywords": [
|
|
7
|
+
"keywords": [
|
|
8
|
+
"node",
|
|
9
|
+
"node-server",
|
|
10
|
+
"api",
|
|
11
|
+
"api-server",
|
|
12
|
+
"https"
|
|
13
|
+
],
|
|
8
14
|
"main": "lib/index.js",
|
|
9
15
|
"repository": {
|
|
10
16
|
"type": "git",
|
|
@@ -29,7 +35,7 @@
|
|
|
29
35
|
"mikroserve": "lib/index.js"
|
|
30
36
|
},
|
|
31
37
|
"scripts": {
|
|
32
|
-
"start": "npx tsx src/index.ts
|
|
38
|
+
"start": "npx tsx src/index.ts",
|
|
33
39
|
"test": "npm run test:licenses && npm run test:types && npm run lint && npm run test:unit",
|
|
34
40
|
"test:types": "npx type-coverage --at-least 85 --strict --ignore-files \"tests/**/*.ts\" --ignore-files \"*.ts\" --ignore-files \"src/application/errors/*.ts\" --ignore-files \"testdata/*.ts\"",
|
|
35
41
|
"test:licenses": "npx license-compliance --direct --allow 'MIT;ISC;0BSD;BSD-2-Clause;BSD-3-Clause;Apache-2.0;Unlicense;CC0-1.0'",
|