@sveltejs/adapter-netlify 1.0.0-next.48 → 1.0.0-next.49
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 +3 -1
- package/files/cjs/handler.js +2 -2
- package/files/esm/handler.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -57,7 +57,9 @@ During compilation, redirect rules are automatically appended to your `_redirect
|
|
|
57
57
|
|
|
58
58
|
### Using Netlify Functions
|
|
59
59
|
|
|
60
|
-
[Netlify Functions](https://docs.netlify.com/functions/overview/)
|
|
60
|
+
With this adapter, SvelteKit endpoints are hosted as [Netlify Functions](https://docs.netlify.com/functions/overview/). Netlify function handlers have additional context, including [Netlify Identity](https://docs.netlify.com/visitor-access/identity/) information. You can access this context via the `event.platform.context` field inside your hooks and endpoints.
|
|
61
|
+
|
|
62
|
+
Additionally, you can add your own Netlify functions by creating a directory for them and adding the configuration to your `netlify.toml` file. For example:
|
|
61
63
|
|
|
62
64
|
```toml
|
|
63
65
|
[build]
|
package/files/cjs/handler.js
CHANGED
|
@@ -49,8 +49,8 @@ function split_headers(headers) {
|
|
|
49
49
|
function init(manifest) {
|
|
50
50
|
const server = new _0SERVER.Server(manifest);
|
|
51
51
|
|
|
52
|
-
return async (event) => {
|
|
53
|
-
const rendered = await server.respond(to_request(event));
|
|
52
|
+
return async (event, context) => {
|
|
53
|
+
const rendered = await server.respond(to_request(event), { platform: { context } });
|
|
54
54
|
|
|
55
55
|
const partial_response = {
|
|
56
56
|
statusCode: rendered.status,
|
package/files/esm/handler.js
CHANGED
|
@@ -45,8 +45,8 @@ function split_headers(headers) {
|
|
|
45
45
|
function init(manifest) {
|
|
46
46
|
const server = new Server(manifest);
|
|
47
47
|
|
|
48
|
-
return async (event) => {
|
|
49
|
-
const rendered = await server.respond(to_request(event));
|
|
48
|
+
return async (event, context) => {
|
|
49
|
+
const rendered = await server.respond(to_request(event), { platform: { context } });
|
|
50
50
|
|
|
51
51
|
const partial_response = {
|
|
52
52
|
statusCode: rendered.status,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/adapter-netlify",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.49",
|
|
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.
|
|
34
|
+
"@sveltejs/kit": "1.0.0-next.288",
|
|
35
35
|
"rimraf": "^3.0.2",
|
|
36
36
|
"rollup": "^2.58.0",
|
|
37
37
|
"uvu": "^0.5.2"
|