@rpcbase/server 0.187.0 → 0.188.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 +2 -0
- package/package.json +1 -1
- package/src/client/client_router.js +3 -0
package/express/index.js
CHANGED
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
|
})
|