diff --git a/src/routes/daemon/chain/start.view.ts b/src/routes/daemon/chain/start.view.ts index c2c1f7f..ef90297 100644 --- a/src/routes/daemon/chain/start.view.ts +++ b/src/routes/daemon/chain/start.view.ts @@ -4,7 +4,6 @@ import { Command } from "https://deno.land/x/cliffy/command/mod.ts"; import { StringResponse } from "../../../interfaces/string-response.ts"; import { ProcessManager } from "../../../services/process/process.service.ts"; import { ProcessManagerRequest } from "../../../services/process/processManagerRequest.ts"; -import { ConfigFileService } from "../../../services/config/file.service.ts"; import { FilesystemService } from "../../../services/filesystem.service.ts"; import { IniService } from "../../../services/config/ini.service.ts"; @@ -193,7 +192,7 @@ export class RouteDaemonChainStart { //console.error(`Config file ${args['configFile']} not found`); FilesystemService.ensureDir(path.join(Deno.cwd(), 'conf')) FilesystemService.write(args['configFile'], new IniService().stringify({ - "config-file": args['configFile'], + "log-file": args['logFile'], "data-dir": args['dataDir'], })); } diff --git a/src/services/config/ini.service.ts b/src/services/config/ini.service.ts index 2b71249..edd76ce 100644 --- a/src/services/config/ini.service.ts +++ b/src/services/config/ini.service.ts @@ -55,16 +55,14 @@ export class IniService { stringify(obj: INIObject): string { let str = ""; - for (let i in obj) { //str += `[${i}]\n`; - for (let j in obj[i]) { - let variable = [j, obj[i][j]]; + for (let j in obj) { + let variable = [j, obj[j]]; if (typeof variable[1] === "string") { str += `${variable[0]}="${variable[1]}"\n`; } else { str += `${variable[0]}=${variable[1]}\n`; } - } } return str; } diff --git a/src/services/server.service.ts b/src/services/server.service.ts index cc473dc..603a735 100644 --- a/src/services/server.service.ts +++ b/src/services/server.service.ts @@ -193,7 +193,8 @@ export class ServerService { context.response.headers = new Headers({ "content-type": "application/x-www-form-urlencoded, text/plain, application/json", - "Access-Control-Allow-Origin": "*" + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Headers": "*" }); if ((error.message as string).startsWith("http")) { @@ -211,7 +212,8 @@ export class ServerService { context.response.headers = new Headers({ "Content-Type": "application/x-www-form-urlencoded, text/plain, application/json", - "Access-Control-Allow-Origin": "*" + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Headers": "*" }); }); } @@ -225,7 +227,8 @@ export class ServerService { this.router.get("/app/desktop/(.*)", async (context) => { context.response.headers = new Headers({ - "Access-Control-Allow-Origin": "*" + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Headers": "*" }); try { await context.send({ @@ -242,7 +245,8 @@ export class ServerService { this.router.get("(.*)", async (context) => { // context.response.status = 200; context.response.headers = new Headers({ - "Access-Control-Allow-Origin": "*" + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Headers": "*" }); try { await context.send({