@fastly/expressly 2.2.1--canary.47.6578278940.0 → 2.2.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/.yarn/releases/yarn-classic.cjs +147529 -0
- package/.yarnrc.yml +1 -0
- package/README.md +5 -5
- package/dist/lib/routing/error-middleware.d.ts +1 -1
- package/dist/lib/routing/router.d.ts +1 -0
- package/dist/lib/routing/router.js +1 -0
- package/package.json +2 -3
package/.yarnrc.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
yarnPath: .yarn/releases/yarn-classic.cjs
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# expressly
|
|
2
|
-
Express-style router for Fastly
|
|
2
|
+
Express-style router for Fastly Compute.
|
|
3
3
|
|
|
4
4
|
## Using expressly
|
|
5
5
|
|
|
@@ -7,9 +7,9 @@ Express-style router for Fastly's Compute@Edge.
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
First, head over to [developer.fastly.com](https://developer.fastly.com) to get started with JavaScript on Fastly
|
|
10
|
+
First, head over to [developer.fastly.com](https://developer.fastly.com) to get started with JavaScript on Fastly Compute:
|
|
11
11
|
|
|
12
|
-
1. Learn about Compute
|
|
12
|
+
1. Learn about Compute: [developer.fastly.com/learning/compute/](https://developer.fastly.com/learning/compute/)
|
|
13
13
|
2. Create your first JavaScript app: [developer.fastly.com/learning/compute/javascript/](https://developer.fastly.com/learning/compute/javascript/)
|
|
14
14
|
|
|
15
15
|
### Install expressly
|
|
@@ -26,7 +26,7 @@ yarn add @fastly/expressly
|
|
|
26
26
|
|
|
27
27
|
### Your first expressly app
|
|
28
28
|
|
|
29
|
-
Replace the contents of your Compute
|
|
29
|
+
Replace the contents of your Compute app's `src/index.js` with the following:
|
|
30
30
|
|
|
31
31
|
```javascript
|
|
32
32
|
import { Router } from "@fastly/expressly";
|
|
@@ -52,4 +52,4 @@ This will start your service on [http://localhost:7676](http://localhost:7676).
|
|
|
52
52
|
|
|
53
53
|
## Examples
|
|
54
54
|
|
|
55
|
-
Check out the JavaScript code examples for Compute
|
|
55
|
+
Check out the JavaScript code examples for Compute on Fastly's [Developer Hub](https://developer.fastly.com/solutions/examples/javascript/).
|
|
@@ -5,7 +5,7 @@ export type ErrorMiddlewareCallback<Err extends EErr = EErr, Req extends EReq =
|
|
|
5
5
|
export declare class ErrorMiddleware<Err extends EErr = EErr, Req extends EReq = EReq, Res extends ERes = ERes> {
|
|
6
6
|
private matchFn;
|
|
7
7
|
private callback;
|
|
8
|
-
constructor(matchFn: Function, callback: ErrorMiddlewareCallback
|
|
8
|
+
constructor(matchFn: Function, callback: ErrorMiddlewareCallback);
|
|
9
9
|
check(event: Req): 0 | 404 | string[];
|
|
10
10
|
run(err: Err, req: Req, res: Res): Promise<any>;
|
|
11
11
|
}
|
|
@@ -15,6 +15,7 @@ export declare class Router<Req extends EReq = EReq, Res extends ERes = ERes, Er
|
|
|
15
15
|
/**
|
|
16
16
|
* Handles preflight requests from trusted origins configured by the user when initializing a router.
|
|
17
17
|
* Note that the wildcard value "*" will fail if the request is sent with credentials (see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin#directives)
|
|
18
|
+
* @param autoCorsPreflight the object containing CORS preflight option of trustedOrigins, an array of trusted origins.
|
|
18
19
|
* @returns 200 if the preflight request succeeds, 403 if it fails
|
|
19
20
|
*/
|
|
20
21
|
private preflightHandler;
|
|
@@ -55,6 +55,7 @@ export class Router {
|
|
|
55
55
|
/**
|
|
56
56
|
* Handles preflight requests from trusted origins configured by the user when initializing a router.
|
|
57
57
|
* Note that the wildcard value "*" will fail if the request is sent with credentials (see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin#directives)
|
|
58
|
+
* @param autoCorsPreflight the object containing CORS preflight option of trustedOrigins, an array of trusted origins.
|
|
58
59
|
* @returns 200 if the preflight request succeeds, 403 if it fails
|
|
59
60
|
*/
|
|
60
61
|
async preflightHandler(req, res) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastly/expressly",
|
|
3
|
-
"version": "2.2.1
|
|
4
|
-
"description": "Express-style router for Fastly
|
|
3
|
+
"version": "2.2.1",
|
|
4
|
+
"description": "Express-style router for Fastly Compute.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"repository": {
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
},
|
|
20
20
|
"keywords": [
|
|
21
21
|
"fastly",
|
|
22
|
-
"c@e",
|
|
23
22
|
"compute",
|
|
24
23
|
"edge",
|
|
25
24
|
"router"
|