const Service = require("node-windows").Service; const path = require("path"); const svc = new Service({ name: "Image Moderation Service", description: "Standalone image moderation service using local vision AI", 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();