construct-hub-webapp 0.1.235 → 0.1.236

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/cypress.json CHANGED
@@ -1,3 +1,9 @@
1
1
  {
2
- "baseUrl": "http://localhost:3000"
3
- }
2
+ "baseUrl": "http://localhost:3000",
3
+ "blockedHosts": [
4
+ "*.awsstatic.com",
5
+ "*omtrdc.net",
6
+ "*.shortbread.aws.dev"
7
+ ],
8
+ "chromeWebSecurity": false
9
+ }
package/package.json CHANGED
@@ -23,7 +23,8 @@
23
23
  "eject": "npx projen eject",
24
24
  "cypress:open": "npx projen cypress:open",
25
25
  "cypress:run": "npx projen cypress:run",
26
- "start:ci": "npx projen start:ci",
26
+ "proxy-server": "npx projen proxy-server",
27
+ "proxy-server:ci": "npx projen proxy-server:ci",
27
28
  "test:unit": "npx projen test:unit",
28
29
  "release": "npx projen release",
29
30
  "projen": "npx projen"
@@ -57,6 +58,8 @@
57
58
  "eslint-plugin-prettier": "^3.4.1",
58
59
  "eslint-plugin-react": "^7.25.2",
59
60
  "eslint-plugin-react-hooks": "^4.2.0",
61
+ "express": "^4.17.1",
62
+ "express-http-proxy": "^1.6.2",
60
63
  "json-schema": "^0.3.0",
61
64
  "npm-check-updates": "^11",
62
65
  "prettier": "^2.4.1",
@@ -98,7 +101,7 @@
98
101
  },
99
102
  "bundledDependencies": [],
100
103
  "license": "Apache-2.0",
101
- "version": "0.1.235",
104
+ "version": "0.1.236",
102
105
  "eslintConfig": {
103
106
  "extends": [
104
107
  "react-app",
package/proxy.js ADDED
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @fileoverview A simple proxy server to test the locally built webapp against real data.
3
+ * This is only intended for local testing + testing in CI
4
+ */
5
+ const express = require("express");
6
+ const path = require("path");
7
+ const proxy = require("express-http-proxy");
8
+ const proxyUrl = require("./package.json").proxy;
9
+
10
+ const app = express();
11
+ const port = process.env.PORT || 3000;
12
+
13
+ const buildDir = path.join(__dirname, "build");
14
+
15
+ app.use(express.static(buildDir));
16
+
17
+ app.use(proxy(proxyUrl));
18
+
19
+ app.get("*", (req, res) => {
20
+ res.sendFile(path.join(buildDir, "index.html"));
21
+ });
22
+
23
+ app.listen(port);
24
+
25
+ console.log("Proxy server started on port ", port);