heyio 0.1.30 → 0.1.31
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/api/server.js +8 -5
- package/package.json +1 -1
package/dist/api/server.js
CHANGED
|
@@ -132,17 +132,20 @@ export async function startApiServer() {
|
|
|
132
132
|
sseConnections.delete(res);
|
|
133
133
|
});
|
|
134
134
|
});
|
|
135
|
-
// Mount API at /api (for frontend)
|
|
135
|
+
// Mount API at /api (for frontend)
|
|
136
136
|
app.use("/api", api);
|
|
137
|
-
|
|
138
|
-
// Serve Vue frontend if built assets exist
|
|
137
|
+
// Serve Vue frontend if built assets exist (before backward-compat API mount)
|
|
139
138
|
if (existsSync(WEB_DIST)) {
|
|
140
139
|
app.use(express.static(WEB_DIST));
|
|
141
|
-
|
|
140
|
+
console.log("[io] Web frontend enabled");
|
|
141
|
+
}
|
|
142
|
+
// Backward-compat: mount API at / (after static files so HTML/CSS/JS are served first)
|
|
143
|
+
app.use("/", api);
|
|
144
|
+
// SPA fallback — serve index.html for any unmatched route
|
|
145
|
+
if (existsSync(WEB_DIST)) {
|
|
142
146
|
app.get("/{*splat}", (_req, res) => {
|
|
143
147
|
res.sendFile(path.join(WEB_DIST, "index.html"));
|
|
144
148
|
});
|
|
145
|
-
console.log("[io] Web frontend enabled");
|
|
146
149
|
}
|
|
147
150
|
return new Promise((resolve) => {
|
|
148
151
|
app.listen(config.port, () => {
|