From 16c5450d408b73e8ca683805aa02f9aef9b9c83e Mon Sep 17 00:00:00 2001 From: wukko Date: Sun, 20 Oct 2024 19:07:42 +0600 Subject: [PATCH] api/cobalt: update api url error message --- api/src/cobalt.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/api/src/cobalt.js b/api/src/cobalt.js index c548e792..363930ba 100644 --- a/api/src/cobalt.js +++ b/api/src/cobalt.js @@ -2,26 +2,24 @@ import "dotenv/config"; import express from "express"; -import path from 'path'; -import { fileURLToPath } from 'url'; +import path from "path"; +import { fileURLToPath } from "url"; import { env } from "./config.js" -import { Bright, Green, Red } from "./misc/console-text.js"; +import { Red } from "./misc/console-text.js"; const app = express(); const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename).slice(0, -4); -app.disable('x-powered-by'); +app.disable("x-powered-by"); if (env.apiURL) { - const { runAPI } = await import('./core/api.js'); + const { runAPI } = await import("./core/api.js"); runAPI(express, app, __dirname) } else { console.log( - Red(`cobalt wasn't configured yet or configuration is invalid.\n`) - + Bright(`please run the setup script to fix this: `) - + Green(`npm run setup`) + Red("API_URL env variable is missing, cobalt api can't start.") ) }