@server/next 0.20.30 → 0.20.31
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/package.json +1 -1
- package/src/index.js +7 -3
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -168,10 +168,14 @@ export default function server(options = {}) {
|
|
|
168
168
|
};
|
|
169
169
|
|
|
170
170
|
this.netlify = async (request) => {
|
|
171
|
-
if (typeof Netlify === "undefined") throw new Error("Unknown");
|
|
172
|
-
console.log("Experimental Netlify");
|
|
173
171
|
try {
|
|
174
|
-
|
|
172
|
+
if (typeof Netlify === "undefined") {
|
|
173
|
+
throw new Error("Netlify doesn't exist");
|
|
174
|
+
}
|
|
175
|
+
if (typeof import.meta === "undefined") {
|
|
176
|
+
throw new Error("import.meta.env doesn't exist");
|
|
177
|
+
}
|
|
178
|
+
options = validateOptions(options, import.meta.env);
|
|
175
179
|
const ctx = await createWinterContext(request, options, this);
|
|
176
180
|
extendWithDefaults(ctx);
|
|
177
181
|
return await handleRequest(this.handlers, ctx);
|