hono 0.2.3 → 0.3.2
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 +16 -6
- package/dist/compose.js +5 -1
- package/dist/context.js +16 -3
- package/dist/hono.d.ts +1 -0
- package/dist/hono.js +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -3
- package/dist/middleware/basic-auth/basic-auth.js +16 -3
- package/dist/middleware/body-parse/body-parse.d.ts +0 -5
- package/dist/middleware/mustache/mustache.js +19 -14
- package/dist/middleware/serve-static/serve-static.d.ts +6 -0
- package/dist/middleware/serve-static/serve-static.js +44 -0
- package/dist/middleware.d.ts +0 -22
- package/dist/middleware.js +0 -14
- package/dist/utils/cloudflare.d.ts +1 -1
- package/dist/utils/cloudflare.js +1 -2
- package/dist/utils/mime.d.ts +1 -0
- package/dist/utils/mime.js +92 -0
- package/package.json +41 -2
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ Fastest is hono
|
|
|
35
35
|
|
|
36
36
|
Below is a demonstration to create an application of Cloudflare Workers with Hono.
|
|
37
37
|
|
|
38
|
-

|
|
39
39
|
|
|
40
40
|
## Install
|
|
41
41
|
|
|
@@ -138,19 +138,24 @@ app.get('/fetch-url', async (c) => {
|
|
|
138
138
|
### Builtin Middleware
|
|
139
139
|
|
|
140
140
|
```js
|
|
141
|
-
import { Hono
|
|
141
|
+
import { Hono } from 'hono'
|
|
142
|
+
import { poweredBy } from 'hono/powered-by'
|
|
143
|
+
import { logger } from 'hono/logger'
|
|
144
|
+
import { basicAuth } from 'hono/basicAuth'
|
|
142
145
|
|
|
143
|
-
|
|
146
|
+
const app = new Hono()
|
|
144
147
|
|
|
145
|
-
app.use('*',
|
|
146
|
-
app.use('*',
|
|
148
|
+
app.use('*', poweredBy())
|
|
149
|
+
app.use('*', logger())
|
|
147
150
|
app.use(
|
|
148
151
|
'/auth/*',
|
|
149
|
-
|
|
152
|
+
basicAuth({
|
|
150
153
|
username: 'hono',
|
|
151
154
|
password: 'acoolproject',
|
|
152
155
|
})
|
|
153
156
|
)
|
|
157
|
+
|
|
158
|
+
...
|
|
154
159
|
```
|
|
155
160
|
|
|
156
161
|
Available builtin middleware are listed on [src/middleware](https://github.com/yusukebe/hono/tree/master/src/middleware).
|
|
@@ -358,6 +363,11 @@ export default {
|
|
|
358
363
|
return app.fetch(request, env, event)
|
|
359
364
|
},
|
|
360
365
|
}
|
|
366
|
+
|
|
367
|
+
/*
|
|
368
|
+
or just do this:
|
|
369
|
+
export default app
|
|
370
|
+
*/
|
|
361
371
|
```
|
|
362
372
|
|
|
363
373
|
## Cloudflare Workers with Hono
|
package/dist/compose.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.compose = void 0;
|
|
4
4
|
// Based on the code in the MIT licensed `koa-compose` package.
|
|
5
5
|
const compose = (middleware) => {
|
|
6
|
+
const errors = [];
|
|
6
7
|
return function (context, next) {
|
|
7
8
|
let index = -1;
|
|
8
9
|
return dispatch(0);
|
|
@@ -16,7 +17,10 @@ const compose = (middleware) => {
|
|
|
16
17
|
if (!fn)
|
|
17
18
|
return Promise.resolve();
|
|
18
19
|
try {
|
|
19
|
-
return Promise.resolve(fn(context, dispatch.bind(null, i + 1)))
|
|
20
|
+
return Promise.resolve(fn(context, dispatch.bind(null, i + 1))).catch((e) => {
|
|
21
|
+
errors.push(e);
|
|
22
|
+
throw errors[0]; // XXX
|
|
23
|
+
});
|
|
20
24
|
}
|
|
21
25
|
catch (err) {
|
|
22
26
|
return Promise.reject(err);
|
package/dist/context.js
CHANGED
|
@@ -24,9 +24,22 @@ class Context {
|
|
|
24
24
|
newResponse(data, init = {}) {
|
|
25
25
|
init.status = init.status || this._status;
|
|
26
26
|
init.statusText = init.statusText || this._statusText;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
init.headers = Object.assign(Object.assign({}, this._headers), init.headers);
|
|
28
|
+
// Content-Length
|
|
29
|
+
let length = 0;
|
|
30
|
+
if (data) {
|
|
31
|
+
if (data instanceof ArrayBuffer) {
|
|
32
|
+
length = data.byteLength;
|
|
33
|
+
}
|
|
34
|
+
else if (typeof data == 'string') {
|
|
35
|
+
const Encoder = new TextEncoder();
|
|
36
|
+
length = Encoder.encode(data).byteLength || 0;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
length = data.bytelength;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
init.headers = Object.assign(Object.assign({}, init.headers), { 'Content-Length': length.toString() });
|
|
30
43
|
return new Response(data, init);
|
|
31
44
|
}
|
|
32
45
|
body(data, status = this._status, headers = this._headers) {
|
package/dist/hono.d.ts
CHANGED
package/dist/hono.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Context = exports.
|
|
3
|
+
exports.Context = exports.Hono = void 0;
|
|
4
4
|
var hono_1 = require("./hono");
|
|
5
5
|
Object.defineProperty(exports, "Hono", { enumerable: true, get: function () { return hono_1.Hono; } });
|
|
6
|
-
var middleware_1 = require("./middleware");
|
|
7
|
-
Object.defineProperty(exports, "Middleware", { enumerable: true, get: function () { return middleware_1.Middleware; } });
|
|
8
6
|
var context_1 = require("./context");
|
|
9
7
|
Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return context_1.Context; } });
|
|
@@ -25,7 +25,20 @@ const auth = (req) => {
|
|
|
25
25
|
return { username: userPass[1], password: userPass[2] };
|
|
26
26
|
};
|
|
27
27
|
function decodeBase64(str) {
|
|
28
|
-
|
|
28
|
+
if (atob) {
|
|
29
|
+
const text = atob(str);
|
|
30
|
+
const length = text.length;
|
|
31
|
+
const bytes = new Uint8Array(length);
|
|
32
|
+
for (let i = 0; i < length; i++) {
|
|
33
|
+
bytes[i] = text.charCodeAt(i);
|
|
34
|
+
}
|
|
35
|
+
const decoder = new TextDecoder();
|
|
36
|
+
return decoder.decode(bytes);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const { Buffer } = require('buffer');
|
|
40
|
+
return Buffer.from(str, 'base64').toString();
|
|
41
|
+
}
|
|
29
42
|
}
|
|
30
43
|
const basicAuth = (options) => {
|
|
31
44
|
if (!options.realm) {
|
|
@@ -33,8 +46,8 @@ const basicAuth = (options) => {
|
|
|
33
46
|
}
|
|
34
47
|
return async (ctx, next) => {
|
|
35
48
|
const user = auth(ctx.req);
|
|
36
|
-
const usernameEqual = user && await (0, buffer_1.timingSafeEqual)(options.username, user.username);
|
|
37
|
-
const passwordEqual = user && await (0, buffer_1.timingSafeEqual)(options.password, user.password);
|
|
49
|
+
const usernameEqual = user && (await (0, buffer_1.timingSafeEqual)(options.username, user.username));
|
|
50
|
+
const passwordEqual = user && (await (0, buffer_1.timingSafeEqual)(options.password, user.password));
|
|
38
51
|
if (!user || !usernameEqual || !passwordEqual) {
|
|
39
52
|
ctx.res = new Response('Unauthorized', {
|
|
40
53
|
status: 401,
|
|
@@ -4,31 +4,29 @@ exports.mustache = void 0;
|
|
|
4
4
|
const cloudflare_1 = require("../../utils/cloudflare");
|
|
5
5
|
const EXTENSION = '.mustache';
|
|
6
6
|
const mustache = () => {
|
|
7
|
-
let Mustache;
|
|
8
|
-
try {
|
|
9
|
-
Mustache = require('mustache');
|
|
10
|
-
}
|
|
11
|
-
catch (_a) {
|
|
12
|
-
// Do nothing.
|
|
13
|
-
}
|
|
14
7
|
return async (c, next) => {
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
let Mustache;
|
|
9
|
+
try {
|
|
10
|
+
Mustache = require('mustache');
|
|
11
|
+
}
|
|
12
|
+
catch (_a) {
|
|
13
|
+
throw new Error('If you want to use Mustache Middleware, install "mustache" package first.');
|
|
17
14
|
}
|
|
18
15
|
c.render = async (filename, view = {}, options) => {
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
16
|
+
const buffer = await (0, cloudflare_1.getContentFromKVAsset)(`${filename}${EXTENSION}`);
|
|
17
|
+
if (!buffer) {
|
|
21
18
|
throw new Error(`Template "${filename}${EXTENSION}" is not found or blank.`);
|
|
22
19
|
}
|
|
20
|
+
const content = bufferToString(buffer);
|
|
23
21
|
const partialArgs = {};
|
|
24
22
|
if (options) {
|
|
25
23
|
const partials = options;
|
|
26
24
|
for (const key of Object.keys(partials)) {
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
25
|
+
const partialBuffer = await (0, cloudflare_1.getContentFromKVAsset)(`${partials[key]}${EXTENSION}`);
|
|
26
|
+
if (!partialBuffer) {
|
|
29
27
|
throw new Error(`Partial Template "${partials[key]}${EXTENSION}" is not found or blank.`);
|
|
30
28
|
}
|
|
31
|
-
partialArgs[key] =
|
|
29
|
+
partialArgs[key] = bufferToString(partialBuffer);
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
32
|
const output = Mustache.render(content, view, partialArgs);
|
|
@@ -38,3 +36,10 @@ const mustache = () => {
|
|
|
38
36
|
};
|
|
39
37
|
};
|
|
40
38
|
exports.mustache = mustache;
|
|
39
|
+
const bufferToString = (buffer) => {
|
|
40
|
+
if (buffer instanceof ArrayBuffer) {
|
|
41
|
+
const enc = new TextDecoder('utf-8');
|
|
42
|
+
return enc.decode(buffer);
|
|
43
|
+
}
|
|
44
|
+
return buffer;
|
|
45
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serveStatic = void 0;
|
|
4
|
+
const cloudflare_1 = require("../../utils/cloudflare");
|
|
5
|
+
const mime_1 = require("../../utils/mime");
|
|
6
|
+
const DEFAULT_DOCUMENT = 'index.html';
|
|
7
|
+
// This middleware is available only on Cloudflare Workers.
|
|
8
|
+
const serveStatic = (opt = { root: '' }) => {
|
|
9
|
+
return async (c, next) => {
|
|
10
|
+
await next();
|
|
11
|
+
const url = new URL(c.req.url);
|
|
12
|
+
const path = getKVPath(url.pathname, opt.root);
|
|
13
|
+
const content = await (0, cloudflare_1.getContentFromKVAsset)(path);
|
|
14
|
+
if (content) {
|
|
15
|
+
const mimeType = (0, mime_1.getMimeType)(path);
|
|
16
|
+
if (mimeType) {
|
|
17
|
+
c.header('Content-Type', mimeType);
|
|
18
|
+
}
|
|
19
|
+
c.res = c.body(content);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
// console.debug(`Static file: ${path} is not found`)
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
exports.serveStatic = serveStatic;
|
|
27
|
+
const getKVPath = (filename, root) => {
|
|
28
|
+
if (filename.endsWith('/')) {
|
|
29
|
+
// /top/ => /top/index.html
|
|
30
|
+
filename = filename.concat(DEFAULT_DOCUMENT);
|
|
31
|
+
}
|
|
32
|
+
else if (!(0, mime_1.getMimeType)(filename)) {
|
|
33
|
+
// /top => /top/index.html
|
|
34
|
+
filename = filename.concat('/' + DEFAULT_DOCUMENT);
|
|
35
|
+
}
|
|
36
|
+
// /foo.html => foo.html
|
|
37
|
+
filename = filename.replace(/^\//, '');
|
|
38
|
+
// assets/ => assets
|
|
39
|
+
root = root.replace(/\/$/, '');
|
|
40
|
+
// ./assets/foo.html => assets/foo.html
|
|
41
|
+
let path = root + '/' + filename;
|
|
42
|
+
path = path.replace(/^\.?\//, '');
|
|
43
|
+
return path;
|
|
44
|
+
};
|
package/dist/middleware.d.ts
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
1
|
export declare class Middleware {
|
|
2
2
|
static default: (c: import("./context").Context, next: Function) => Promise<void>;
|
|
3
|
-
static poweredBy: () => (c: import("./context").Context, next: Function) => Promise<void>;
|
|
4
|
-
static logger: (fn?: {
|
|
5
|
-
(...data: any[]): void;
|
|
6
|
-
(...data: any[]): void;
|
|
7
|
-
(message?: any, ...optionalParams: any[]): void;
|
|
8
|
-
}) => (c: import("./context").Context, next: Function) => Promise<void>;
|
|
9
|
-
static basicAuth: (options: {
|
|
10
|
-
username: string;
|
|
11
|
-
password: string;
|
|
12
|
-
realm?: string;
|
|
13
|
-
}) => (ctx: import("./context").Context, next: Function) => Promise<any>;
|
|
14
|
-
static bodyParse: () => (ctx: import("./context").Context, next: Function) => Promise<void>;
|
|
15
|
-
static cors: (options?: {
|
|
16
|
-
origin: string;
|
|
17
|
-
allowMethods?: string[];
|
|
18
|
-
allowHeaders?: string[];
|
|
19
|
-
maxAge?: number;
|
|
20
|
-
credentials?: boolean;
|
|
21
|
-
exposeHeaders?: string[];
|
|
22
|
-
}) => (c: import("./context").Context, next: Function) => Promise<void>;
|
|
23
|
-
static cookie: () => (c: import("./context").Context, next: Function) => Promise<void>;
|
|
24
|
-
static mustache: () => (c: import("./context").Context, next: Function) => Promise<void>;
|
|
25
3
|
}
|
package/dist/middleware.js
CHANGED
|
@@ -2,21 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Middleware = void 0;
|
|
4
4
|
const default_1 = require("./middleware/default");
|
|
5
|
-
const powered_by_1 = require("./middleware/powered-by/powered-by");
|
|
6
|
-
const logger_1 = require("./middleware/logger/logger");
|
|
7
|
-
const basic_auth_1 = require("./middleware/basic-auth/basic-auth");
|
|
8
|
-
const body_parse_1 = require("./middleware/body-parse/body-parse");
|
|
9
|
-
const cors_1 = require("./middleware/cors/cors");
|
|
10
|
-
const cookie_1 = require("./middleware/cookie/cookie");
|
|
11
|
-
const mustache_1 = require("./middleware/mustache/mustache");
|
|
12
5
|
class Middleware {
|
|
13
6
|
}
|
|
14
7
|
exports.Middleware = Middleware;
|
|
15
8
|
Middleware.default = default_1.defaultMiddleware;
|
|
16
|
-
Middleware.poweredBy = powered_by_1.poweredBy;
|
|
17
|
-
Middleware.logger = logger_1.logger;
|
|
18
|
-
Middleware.basicAuth = basic_auth_1.basicAuth;
|
|
19
|
-
Middleware.bodyParse = body_parse_1.bodyParse;
|
|
20
|
-
Middleware.cors = cors_1.cors;
|
|
21
|
-
Middleware.cookie = cookie_1.cookie;
|
|
22
|
-
Middleware.mustache = mustache_1.mustache;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getContentFromKVAsset: (path: string) => Promise<
|
|
1
|
+
export declare const getContentFromKVAsset: (path: string) => Promise<ArrayBuffer>;
|
package/dist/utils/cloudflare.js
CHANGED
|
@@ -14,8 +14,7 @@ const getContentFromKVAsset = async (path) => {
|
|
|
14
14
|
if (!key) {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
let content;
|
|
18
|
-
content = await ASSET_NAMESPACE.get(key, { type: 'text' });
|
|
17
|
+
let content = await ASSET_NAMESPACE.get(key, { type: 'arrayBuffer' });
|
|
19
18
|
if (content) {
|
|
20
19
|
content = content;
|
|
21
20
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getMimeType: (filename: string) => string;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMimeType = void 0;
|
|
4
|
+
const getMimeType = (filename) => {
|
|
5
|
+
const regexp = /\.([a-zA-Z0-9]+?)$/;
|
|
6
|
+
const match = filename.match(regexp);
|
|
7
|
+
if (!match) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
let mimeType = mimes[match[1]];
|
|
11
|
+
if (mimeType.startsWith('text') || mimeType === 'application/json') {
|
|
12
|
+
mimeType += '; charset=utf-8';
|
|
13
|
+
}
|
|
14
|
+
return mimeType;
|
|
15
|
+
};
|
|
16
|
+
exports.getMimeType = getMimeType;
|
|
17
|
+
const mimes = {
|
|
18
|
+
aac: 'audio/aac',
|
|
19
|
+
abw: 'application/x-abiword',
|
|
20
|
+
arc: 'application/x-freearc',
|
|
21
|
+
avi: 'video/x-msvideo',
|
|
22
|
+
azw: 'application/vnd.amazon.ebook',
|
|
23
|
+
bin: 'application/octet-stream',
|
|
24
|
+
bmp: 'image/bmp',
|
|
25
|
+
bz: 'application/x-bzip',
|
|
26
|
+
bz2: 'application/x-bzip2',
|
|
27
|
+
csh: 'application/x-csh',
|
|
28
|
+
css: 'text/css',
|
|
29
|
+
csv: 'text/csv',
|
|
30
|
+
doc: 'application/msword',
|
|
31
|
+
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
32
|
+
eot: 'application/vnd.ms-fontobject',
|
|
33
|
+
epub: 'application/epub+zip',
|
|
34
|
+
gz: 'application/gzip',
|
|
35
|
+
gif: 'image/gif',
|
|
36
|
+
htm: 'text/html',
|
|
37
|
+
html: 'text/html',
|
|
38
|
+
ico: 'image/vnd.microsoft.icon',
|
|
39
|
+
ics: 'text/calendar',
|
|
40
|
+
jar: 'application/java-archive',
|
|
41
|
+
jpeg: 'image/jpeg',
|
|
42
|
+
jpg: 'image/jpeg',
|
|
43
|
+
js: 'text/javascript',
|
|
44
|
+
json: 'application/json',
|
|
45
|
+
jsonld: 'application/ld+json',
|
|
46
|
+
mid: 'audio/x-midi',
|
|
47
|
+
midi: 'audio/x-midi',
|
|
48
|
+
mjs: 'text/javascript',
|
|
49
|
+
mp3: 'audio/mpeg',
|
|
50
|
+
mpeg: 'video/mpeg',
|
|
51
|
+
mpkg: 'application/vnd.apple.installer+xml',
|
|
52
|
+
odp: 'application/vnd.oasis.opendocument.presentation',
|
|
53
|
+
ods: 'application/vnd.oasis.opendocument.spreadsheet',
|
|
54
|
+
odt: 'application/vnd.oasis.opendocument.text',
|
|
55
|
+
oga: 'audio/ogg',
|
|
56
|
+
ogv: 'video/ogg',
|
|
57
|
+
ogx: 'application/ogg',
|
|
58
|
+
opus: 'audio/opus',
|
|
59
|
+
otf: 'font/otf',
|
|
60
|
+
png: 'image/png',
|
|
61
|
+
pdf: 'application/pdf',
|
|
62
|
+
php: 'application/php',
|
|
63
|
+
ppt: 'application/vnd.ms-powerpoint',
|
|
64
|
+
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
65
|
+
rar: 'application/vnd.rar',
|
|
66
|
+
rtf: 'application/rtf',
|
|
67
|
+
sh: 'application/x-sh',
|
|
68
|
+
svg: 'image/svg+xml',
|
|
69
|
+
swf: 'application/x-shockwave-flash',
|
|
70
|
+
tar: 'application/x-tar',
|
|
71
|
+
tif: 'image/tiff',
|
|
72
|
+
tiff: 'image/tiff',
|
|
73
|
+
ts: 'video/mp2t',
|
|
74
|
+
ttf: 'font/ttf',
|
|
75
|
+
txt: 'text/plain',
|
|
76
|
+
vsd: 'application/vnd.visio',
|
|
77
|
+
wav: 'audio/wav',
|
|
78
|
+
weba: 'audio/webm',
|
|
79
|
+
webm: 'video/webm',
|
|
80
|
+
webp: 'image/webp',
|
|
81
|
+
woff: 'font/woff',
|
|
82
|
+
woff2: 'font/woff2',
|
|
83
|
+
xhtml: 'application/xhtml+xml',
|
|
84
|
+
xls: 'application/vnd.ms-excel',
|
|
85
|
+
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
86
|
+
xml: 'application/xml',
|
|
87
|
+
xul: 'application/vnd.mozilla.xul+xml',
|
|
88
|
+
zip: 'application/zip',
|
|
89
|
+
'3gp': 'video/3gpp',
|
|
90
|
+
'3g2': 'video/3gpp2',
|
|
91
|
+
'7z': 'application/x-7z-compressed',
|
|
92
|
+
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hono",
|
|
3
|
-
"version": "0.2
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "[炎] Ultrafast web framework for Cloudflare Workers.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./dist/index.js",
|
|
12
|
+
"./basic-auth": "./dist/middleware/basic-auth/basic-auth.js",
|
|
13
|
+
"./body-parse": "./dist/middleware/body-parse/body-parse.js",
|
|
14
|
+
"./cookie": "./dist/middleware/cookie/cookie.js",
|
|
15
|
+
"./cors": "./dist/middleware/cors/cors.js",
|
|
16
|
+
"./logger": "./dist/middleware/logger/logger.js",
|
|
17
|
+
"./mustache": "./dist/middleware/mustache/mustache.js",
|
|
18
|
+
"./powered-by": "./dist/middleware/powered-by/powered-by.js",
|
|
19
|
+
"./serve-static": "./dist/middleware/serve-static/serve-static.js"
|
|
20
|
+
},
|
|
21
|
+
"typesVersions": {
|
|
22
|
+
"*": {
|
|
23
|
+
"basic-auth": [
|
|
24
|
+
"./dist/middleware/basic-auth/basic-auth.d.ts"
|
|
25
|
+
],
|
|
26
|
+
"body-parse": [
|
|
27
|
+
"./dist/middleware/body-parse/body-parse.d.ts"
|
|
28
|
+
],
|
|
29
|
+
"cookie": [
|
|
30
|
+
"./dist/middleware/cookie/cookie.d.ts"
|
|
31
|
+
],
|
|
32
|
+
"cors": [
|
|
33
|
+
"./dist/middleware/cors/cors.d.ts"
|
|
34
|
+
],
|
|
35
|
+
"logger": [
|
|
36
|
+
"./dist/middleware/logger/logger.d.ts"
|
|
37
|
+
],
|
|
38
|
+
"mustache": [
|
|
39
|
+
"./dist/middleware/mustache/mustache.d.ts"
|
|
40
|
+
],
|
|
41
|
+
"powered-by": [
|
|
42
|
+
"./dist/middleware/powered-by/powered-by.d.ts"
|
|
43
|
+
],
|
|
44
|
+
"serve-static": [
|
|
45
|
+
"./dist/middleware/serve-static/serve-static.d.ts"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
10
49
|
"scripts": {
|
|
11
50
|
"test": "jest",
|
|
12
51
|
"lint": "eslint --ext js,ts src .eslintrc.js test",
|
|
@@ -55,7 +94,7 @@
|
|
|
55
94
|
"mustache": "^4.2.0",
|
|
56
95
|
"rimraf": "^3.0.2",
|
|
57
96
|
"ts-jest": "^27.1.2",
|
|
58
|
-
"typescript": "^4.5.
|
|
97
|
+
"typescript": "^4.5.5"
|
|
59
98
|
},
|
|
60
99
|
"engines": {
|
|
61
100
|
"node": ">=11.0.0"
|