@saasquatch/program-boilerplate 3.7.1 → 3.7.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/dist/index.js +3 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -68,19 +68,9 @@ function webtask(program = {}) {
|
|
|
68
68
|
app.use(express_1.default.json({ limit: process.env.MAX_PAYLOAD_SIZE || "1mb" }));
|
|
69
69
|
app.use(compression());
|
|
70
70
|
app.use(logger_3.httpLogMiddleware(logger));
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (process.env.NODE_ENV === "production" &&
|
|
75
|
-
req.header("X-Forwarded-Proto") !== "https") {
|
|
76
|
-
return res.status(403).send({ message: "SSL required" });
|
|
77
|
-
}
|
|
78
|
-
// allow the request to continue if https is used
|
|
79
|
-
next();
|
|
80
|
-
});
|
|
81
|
-
app.post("/*", (context, res) => {
|
|
82
|
-
const { json, code } = trigger_1.triggerProgram(context.body, program);
|
|
83
|
-
res.status(code).json(json);
|
|
71
|
+
app.post("/*", (req, res) => {
|
|
72
|
+
const { json, code } = trigger_1.triggerProgram(req.body, program);
|
|
73
|
+
return res.status(code).json(json);
|
|
84
74
|
});
|
|
85
75
|
return app;
|
|
86
76
|
}
|