heyio 1.0.0 → 1.0.1
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 +7 -7
- package/package.json +1 -1
package/dist/api/server.js
CHANGED
|
@@ -149,9 +149,9 @@ export async function startApiServer(config) {
|
|
|
149
149
|
const pages = await listPages();
|
|
150
150
|
res.json(pages);
|
|
151
151
|
});
|
|
152
|
-
app.get("/api/wiki/page/*", async (req, res) => {
|
|
152
|
+
app.get("/api/wiki/page/*path", async (req, res) => {
|
|
153
153
|
try {
|
|
154
|
-
const pagePath = req.params
|
|
154
|
+
const pagePath = req.params.path;
|
|
155
155
|
const content = await readPage(pagePath);
|
|
156
156
|
res.json({ path: pagePath, content });
|
|
157
157
|
}
|
|
@@ -159,15 +159,15 @@ export async function startApiServer(config) {
|
|
|
159
159
|
res.status(404).json({ error: err.message });
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
|
-
app.put("/api/wiki/page/*", async (req, res) => {
|
|
163
|
-
const pagePath = req.params
|
|
162
|
+
app.put("/api/wiki/page/*path", async (req, res) => {
|
|
163
|
+
const pagePath = req.params.path;
|
|
164
164
|
const { content } = req.body;
|
|
165
165
|
await writePage(pagePath, content);
|
|
166
166
|
res.json({ ok: true });
|
|
167
167
|
});
|
|
168
|
-
app.delete("/api/wiki/page/*", async (req, res) => {
|
|
168
|
+
app.delete("/api/wiki/page/*path", async (req, res) => {
|
|
169
169
|
try {
|
|
170
|
-
const pagePath = req.params
|
|
170
|
+
const pagePath = req.params.path;
|
|
171
171
|
await deletePage(pagePath);
|
|
172
172
|
res.json({ ok: true });
|
|
173
173
|
}
|
|
@@ -209,7 +209,7 @@ export async function startApiServer(config) {
|
|
|
209
209
|
res.json({ status: "ok", version: process.env.npm_package_version ?? "unknown" });
|
|
210
210
|
});
|
|
211
211
|
// SPA fallback — serve index.html for non-API routes
|
|
212
|
-
app.get("*", (_req, res) => {
|
|
212
|
+
app.get("*splat", (_req, res) => {
|
|
213
213
|
res.sendFile(join(webDistPath, "index.html"));
|
|
214
214
|
});
|
|
215
215
|
app.listen(config.port, () => {
|