@saasquatch/program-boilerplate 3.7.2-5 → 3.7.3

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 (2) hide show
  1. package/dist/index.js +4 -11
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -72,22 +72,15 @@ function webtask(program = {}) {
72
72
  // because OWASP advises not to
73
73
  app.use((req, res, next) => {
74
74
  if (process.env.NODE_ENV === "production" &&
75
- req.header("X-Forwarded-Proto") !== "https" &&
76
- !["/healthz", "/livez", "/readyz"].includes(req.path)) {
75
+ req.header("X-Forwarded-Proto") !== "https") {
77
76
  return res.status(403).send({ message: "SSL required" });
78
77
  }
79
78
  // allow the request to continue if https is used
80
79
  next();
81
80
  });
82
- const healthCheck = (_req, res) => {
83
- return res.status(200).json({ status: "OK" });
84
- };
85
- app.get("/healthz", healthCheck);
86
- app.get("/livez", healthCheck);
87
- app.get("/readyz", healthCheck);
88
- app.post("/*", (req, res) => {
89
- const { json, code } = trigger_1.triggerProgram(req.body, program);
90
- return res.status(code).json(json);
81
+ app.post("/*", (context, res) => {
82
+ const { json, code } = trigger_1.triggerProgram(context.body, program);
83
+ res.status(code).json(json);
91
84
  });
92
85
  return app;
93
86
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasquatch/program-boilerplate",
3
- "version": "3.7.2-5",
3
+ "version": "3.7.3",
4
4
  "description": "Boilerplate for writing programs",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@saasquatch/jsonata-paths-extractor": "^1.0.1",
36
- "@saasquatch/logger": "^1.1.2-0",
36
+ "@saasquatch/logger": "^1.0.0",
37
37
  "bson-objectid": "^1.3.1",
38
38
  "compression": "^1.7.4",
39
39
  "express": "^4.17.1",