@rpcbase/server 0.187.0 → 0.189.0
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/express/index.js +6 -0
- package/package.json +1 -1
- package/src/client/client_router.js +3 -0
package/express/index.js
CHANGED
|
@@ -52,8 +52,11 @@ module.exports = () => {
|
|
|
52
52
|
`https://www.${APP_DOMAIN}`,
|
|
53
53
|
`https://${APP_DOMAIN}`,
|
|
54
54
|
`https://admin.${APP_DOMAIN}`,
|
|
55
|
+
`https://app.posthog.com`,
|
|
56
|
+
`https://eu.posthog.com`,
|
|
55
57
|
] :
|
|
56
58
|
// local dev origins
|
|
59
|
+
// TODO: fixme, make this dynamic!
|
|
57
60
|
[
|
|
58
61
|
`http://127.0.0.1:${CLIENT_PORT}`,
|
|
59
62
|
`http://localhost:${CLIENT_PORT}`,
|
|
@@ -68,6 +71,9 @@ module.exports = () => {
|
|
|
68
71
|
"http://localhost:8090", // TMP: used by inspected app from admin
|
|
69
72
|
"http://localhost:8091", // TMP: used by inspected app from admin
|
|
70
73
|
"http://localhost:9292", // TMP
|
|
74
|
+
// posthog
|
|
75
|
+
`https://app.posthog.com`,
|
|
76
|
+
`https://eu.posthog.com`,
|
|
71
77
|
]
|
|
72
78
|
|
|
73
79
|
if (APP_DOMAIN) {
|
package/package.json
CHANGED
|
@@ -38,6 +38,8 @@ const client_router = (app) => {
|
|
|
38
38
|
app.get("*", async_wrapper(async(req, res, next) => {
|
|
39
39
|
const full_path = req.baseUrl + req.path
|
|
40
40
|
|
|
41
|
+
// TODO: this shouldn't be here,
|
|
42
|
+
// it should be handled by the api and rpc routers being declared before this router
|
|
41
43
|
if (full_path.startsWith("/api/") || full_path.startsWith("/rpc/")) {
|
|
42
44
|
return next()
|
|
43
45
|
}
|
|
@@ -46,6 +48,7 @@ const client_router = (app) => {
|
|
|
46
48
|
const file_path = path.join(client_build_dir, full_path)
|
|
47
49
|
return res.sendFile(file_path)
|
|
48
50
|
} else {
|
|
51
|
+
// TODO: should handle 404 here
|
|
49
52
|
res.writeHead(200, {
|
|
50
53
|
"Content-Type": "text/html"
|
|
51
54
|
})
|