const Service = require("node-windows").Service; const path = require("path"); const svc = new Service({ name: "Vision Scanner Service", description: "Standalone vision scanner service for shelf/pantry photo scanning", script: path.join(__dirname, "dist", "server.js"), nodeOptions: [], env: [ { name: "PATH", value: process.env.PATH }, ], }); svc.on("install", () => { console.log("Service installed. Starting..."); svc.start(); }); svc.on("start", () => { console.log("Service started!"); }); svc.on("error", (err) => { console.error("Error:", err); }); svc.install();