@nicmeriano/spool-server 0.0.4 → 0.0.5
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/bin.js +6 -8
- package/dist/bin.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -420,8 +420,6 @@ interface ServerOptions {
|
|
|
420
420
|
port?: number;
|
|
421
421
|
/** Working directory for state file and agent (default: process.cwd()) */
|
|
422
422
|
cwd?: string;
|
|
423
|
-
/** Don't open the browser when the app URL is reported */
|
|
424
|
-
noOpen?: boolean;
|
|
425
423
|
}
|
|
426
424
|
declare function startServer(options?: ServerOptions): Promise<void>;
|
|
427
425
|
|
package/dist/index.js
CHANGED
|
@@ -126,13 +126,11 @@ function createEventsRoutes(ctx) {
|
|
|
126
126
|
app.post("/app-url", async (c) => {
|
|
127
127
|
const body = await c.req.json();
|
|
128
128
|
console.error(`[spool] Received app URL: ${body.url}`);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
execFile(cmd, [shellUrl]);
|
|
135
|
-
}
|
|
129
|
+
const host = c.req.header("host") || "localhost:3142";
|
|
130
|
+
const shellUrl = `http://${host}`;
|
|
131
|
+
console.error(`[spool] Opening ${shellUrl}`);
|
|
132
|
+
const cmd = platform() === "darwin" ? "open" : platform() === "win32" ? "start" : "xdg-open";
|
|
133
|
+
execFile(cmd, [shellUrl]);
|
|
136
134
|
let state = ctx.getState();
|
|
137
135
|
state = { ...state, appUrl: body.url };
|
|
138
136
|
ctx.setState(state);
|
|
@@ -2063,7 +2061,7 @@ async function startServer(options = {}) {
|
|
|
2063
2061
|
}
|
|
2064
2062
|
}
|
|
2065
2063
|
}));
|
|
2066
|
-
app.route("/api", createEventsRoutes(
|
|
2064
|
+
app.route("/api", createEventsRoutes(routeCtx));
|
|
2067
2065
|
app.route("/api/annotations", createAnnotationsRoutes(routeCtx));
|
|
2068
2066
|
app.route("/api/changes", createChangesRoutes(routeCtx));
|
|
2069
2067
|
app.route("/api/tasks", createTasksRoutes(routeCtx));
|