@sveltejs/adapter-netlify 1.0.0-next.55 → 1.0.0-next.56

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.
Files changed (3) hide show
  1. package/README.md +13 -13
  2. package/files/edge.js +8 -14
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -16,19 +16,19 @@ You can then configure it inside of `svelte.config.js`:
16
16
  import adapter from '@sveltejs/adapter-netlify';
17
17
 
18
18
  export default {
19
- kit: {
20
- // default options are shown
21
- adapter: adapter({
22
- // if true, will create a Netlify Edge Function rather
23
- // than using standard Node-based functions
24
- edge: false,
25
-
26
- // if true, will split your app into multiple functions
27
- // instead of creating a single one for the entire app.
28
- // if `edge` is true, this option cannot be used
29
- split: false
30
- })
31
- }
19
+ kit: {
20
+ // default options are shown
21
+ adapter: adapter({
22
+ // if true, will create a Netlify Edge Function rather
23
+ // than using standard Node-based functions
24
+ edge: false,
25
+
26
+ // if true, will split your app into multiple functions
27
+ // instead of creating a single one for the entire app.
28
+ // if `edge` is true, this option cannot be used
29
+ split: false
30
+ })
31
+ }
32
32
  };
33
33
  ```
34
34
 
package/files/edge.js CHANGED
@@ -9,24 +9,18 @@ const prefix = `/${manifest.appDir}/`;
9
9
  * @param { any } context
10
10
  * @returns { Promise<Response> }
11
11
  */
12
- export default async function handler(request, context) {
12
+ export default function handler(request, context) {
13
13
  if (is_static_file(request)) {
14
14
  // Static files can skip the handler
15
15
  return;
16
16
  }
17
- try {
18
- const response = await server.respond(request, {
19
- platform: { context },
20
- getClientAddress() {
21
- return request.headers.get('x-nf-client-connection-ip');
22
- }
23
- });
24
- return response;
25
- } catch (error) {
26
- return new Response('Error rendering route:' + (error.message || error.toString()), {
27
- status: 500
28
- });
29
- }
17
+
18
+ return server.respond(request, {
19
+ platform: { context },
20
+ getClientAddress() {
21
+ return request.headers.get('x-nf-client-connection-ip');
22
+ }
23
+ });
30
24
  }
31
25
 
32
26
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/adapter-netlify",
3
- "version": "1.0.0-next.55",
3
+ "version": "1.0.0-next.56",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -31,7 +31,7 @@
31
31
  "@rollup/plugin-commonjs": "^21.0.0",
32
32
  "@rollup/plugin-json": "^4.1.0",
33
33
  "@rollup/plugin-node-resolve": "^13.0.5",
34
- "@sveltejs/kit": "1.0.0-next.320",
34
+ "@sveltejs/kit": "1.0.0-next.323",
35
35
  "rimraf": "^3.0.2",
36
36
  "rollup": "^2.58.0",
37
37
  "typescript": "^4.6.2",