Fixing launcher and services and its description

This commit is contained in:
Martin Karkowski 2021-04-23 17:20:57 +02:00
parent b6065273ca
commit 0971185e7b
5 changed files with 23 additions and 10 deletions

View File

@ -17,6 +17,7 @@ import { validLayers } from "../communication/getLayer";
import { createFile } from "../helpers/fileMethods";
import { IConfigFile } from "../loader/loadPackages";
import { getNopeLogger } from "../logger/getLogger";
import { LoggerLevels } from "../logger/nopeLogger";
// Define the Main Function.
// This function is used as cli tool.
@ -113,6 +114,12 @@ export async function createService (
name: "layer",
message: "Select the Communication Layer to use",
choices: Object.getOwnPropertyNames(validLayers)
},
{
type: "list",
name: "logLevel",
message: "Select the Level of the Logger, to use.",
choices: LoggerLevels
}
];
@ -292,7 +299,8 @@ node {{{pathToFolder}}}\\index.js`)
path,
layer: result.layer,
pathToFile: join(path, template.name),
pathToFolder: join(path)
pathToFolder: join(path),
logLevel: result.logLevel
})
);
@ -352,7 +360,6 @@ node {{{pathToFolder}}}\\index.js`)
}
}
// If requested As Main => Perform the Operation.
if (require.main === module) {
createService().catch((e) => console.error(e));

View File

@ -14,9 +14,15 @@ import { runNopeBackend } from "./runNopeBackend";
// Define the Main Function.
// This function is used as cli tool.
export async function runOpenApiServer() {
const dispatcher = await runNopeBackend();
const dispatcher = await runNopeBackend({
channel: "io-client",
log: "info"
});
const result = await startOpenApiBackend(dispatcher, { port: 3001, logger: getNopeLogger("open-api-server", "debug") });
const result = await startOpenApiBackend(dispatcher, {
port: 3001,
logger: getNopeLogger("open-api-server", "info")
});
}
// If requested As Main => Perform the Operation.

View File

@ -12,7 +12,7 @@ if (require.main === module) {
.runNopeBackend({
file: path.join(__dirname, "settings.json"),
channel: "{{layer}}",
log: "debug"
log: "{{logLevel}}"
})
.catch(console.error);
}

View File

@ -20,7 +20,7 @@ const Service = require("node-windows").Service;
// Create a new service object
const svc = new Service({
name: "NoPE - Local {{name}}",
description: "Starts a NOPE-Service under {{{path}}}",
description: "Starts a NOPE-Service for {{name}} under {{{pathToFolder}}}",
script: require("path").join(__dirname, "index.js")
});
const Logger = require("js-logger");

View File

@ -25,7 +25,7 @@ const config = {
options: {
identifier: ("wamo-" + name + "-mirror").toLowerCase(),
params: [
"http://nope-master.demonstrator04.local:7001",
"http://nope-master.demonstrator04.local:7000",
"info", // Logger-Level
false, // considerConnection
false // waitForConnection