@fastly/expressly 1.0.0-alpha.2 → 1.0.0-alpha.3
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
CHANGED
|
@@ -17,11 +17,11 @@ First, head over to [developer.fastly.com](https://developer.fastly.com) to get
|
|
|
17
17
|
Install expressly from the [npm registry](https://www.npmjs.com/package/@fastly/expressly):
|
|
18
18
|
|
|
19
19
|
```shell
|
|
20
|
-
npm i @fastly/expressly@1.0.0-alpha.
|
|
20
|
+
npm i @fastly/expressly@1.0.0-alpha.3
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
```shell
|
|
24
|
-
yarn add @fastly/expressly@1.0.0-alpha.
|
|
24
|
+
yarn add @fastly/expressly@1.0.0-alpha.3
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
### Your first expressly app
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import ERequest from "./request";
|
|
2
|
-
import EResponse from "./response";
|
|
3
|
-
export declare type MiddlewareCallback = (req: ERequest, res: EResponse, next?: () => void) => Promise<any>;
|
|
4
|
-
export declare class Middleware {
|
|
5
|
-
private matchFn;
|
|
6
|
-
private callback;
|
|
7
|
-
constructor(matchFn: Function, callback: MiddlewareCallback);
|
|
8
|
-
check(event: ERequest): 0 | 404 | 405;
|
|
9
|
-
run(req: ERequest, res: EResponse): Promise<any>;
|
|
10
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export class Middleware {
|
|
2
|
-
constructor(matchFn, callback) {
|
|
3
|
-
this.matchFn = matchFn;
|
|
4
|
-
this.callback = callback;
|
|
5
|
-
}
|
|
6
|
-
check(event) {
|
|
7
|
-
return this.matchFn(event);
|
|
8
|
-
}
|
|
9
|
-
async run(req, res) {
|
|
10
|
-
// Supply an empty callback as an equivalent of next() in Express.js.
|
|
11
|
-
await this.callback(req, res, () => { });
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import ERequest from "./request";
|
|
2
|
-
import EResponse from "./response";
|
|
3
|
-
export declare type RequestHandlerCallback = (req: ERequest, res: EResponse) => Promise<any>;
|
|
4
|
-
export declare class Route {
|
|
5
|
-
private matchFn;
|
|
6
|
-
private callback;
|
|
7
|
-
constructor(matchFn: Function, callback: RequestHandlerCallback);
|
|
8
|
-
check(event: ERequest): 0 | 404 | 405;
|
|
9
|
-
run(req: ERequest, res: EResponse): Promise<any>;
|
|
10
|
-
}
|