commit 9f77b9ff93fe21f378fd4d1e956ce97af223eb31
parent 059754090b859310aa034d2b02e312444ec2e85c
Author: Sebastian <sebasjm@taler-systems.com>
Date: Mon, 27 Apr 2026 16:25:32 -0300
listen dev.mjs with socket
Diffstat:
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/packages/merchant-backoffice-ui/dev.mjs b/packages/merchant-backoffice-ui/dev.mjs
@@ -22,6 +22,7 @@ const devEntryPoints = ["src/stories.tsx", "src/index.tsx"];
const build = initializeDev({
type: "development",
+ importMeta: import.meta,
source: {
js: devEntryPoints,
assets: [{base:"src",files:[{orig:"src/index.dev.html", dest: "src/index.html"},"src/settings.json","src/manifest.json","src/android-chrome-512x512.png"]}],
diff --git a/packages/web-util/src/serve.ts b/packages/web-util/src/serve.ts
@@ -25,7 +25,7 @@ async function watch(opts: {
source?: string;
}): Promise<void> {
const watchingFolder = opts.source ?? opts.folder;
- logger.info(`SERVER_DIR detected, server off`)
+ logger.info(`SERVER_DIR detected, server off`);
logger.info(`watching ${watchingFolder} for changes`);
chokidar.watch(watchingFolder).on("change", (path, stats) => {
@@ -51,7 +51,7 @@ export async function serve(opts: {
appSamplePath?: string;
}): Promise<void> {
if (process.env.SERVER_DIR) {
- return watch(opts)
+ return watch(opts);
}
const PATHS = {
WS: "/ws",
@@ -176,12 +176,10 @@ export async function serve(opts: {
</html>`);
});
- logger.info(
- `Serving ${opts.folder} on http://localhost:${httpPort}/ via plain HTTP`,
- );
- httpServer.listen(httpPort);
- if (httpsServer !== undefined) {
- logger.info(`Serving ${opts.folder} on ${httpsPort}: HTTP + TLS`);
- httpsServer.listen(httpsPort);
- }
+ const socketFile = process.env.SOCKET_FILE
+ ? process.env.SOCKET_FILE
+ : httpPort;
+
+ logger.info(`Serving ${opts.folder} on ${socketFile} via plain HTTP`);
+ httpServer.listen(socketFile);
}