templates for services

This commit is contained in:
Martin Karkowski 2021-01-08 09:10:23 +01:00
parent efcb8669a0
commit 7817cfe94a
3 changed files with 32 additions and 1 deletions

5
.gitignore vendored
View File

@ -105,4 +105,7 @@ temp
.tern-port
config/
docs
docs
# Auto-Generated Services
services

View File

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const runNopeBackend = require("../../dist/lib/cli/runNopeBackend");
if (require.main === module) {
process.on("unhandledRejection", (reason, p) => {
console.log("Unhandled Rejection at: Promise", p, "reason:", reason);
console.error(reason);
throw reason;
});
runNopeBackend
.runNopeBackend({
file: path.join(__dirname, "settings.json"),
channel: "io-client",
log: "debug"
})
.catch(console.error);
}

View File

@ -0,0 +1,10 @@
[Unit]
Description={{name}}
After=network.target
[Service]
ExecStart=/usr/bin/node {{pathFile}}
Restart=on-failure
[Install]
WantedBy=multi-user.target