api: remove web mode & variables

This commit is contained in:
wukko
2024-08-02 21:32:00 +06:00
parent eede972ace
commit 2575b0c145
2 changed files with 14 additions and 39 deletions

View File

@@ -6,7 +6,7 @@ import express from "express";
import { Bright, Green, Red } from "./modules/sub/consoleText.js";
import { getCurrentBranch, shortCommit } from "./modules/sub/currentCommit.js";
import { loadLoc } from "./localization/manager.js";
import { mode } from "./modules/config.js"
import { env } from "./modules/config.js"
import path from 'path';
import { fileURLToPath } from 'url';
@@ -23,12 +23,9 @@ app.disable('x-powered-by');
await loadLoc();
if (mode === 'API') {
if (env.apiURL) {
const { runAPI } = await import('./core/api.js');
runAPI(express, app, gitCommit, gitBranch, __dirname)
} else if (mode === 'WEB') {
const { runWeb } = await import('./core/web.js');
await runWeb(express, app, gitCommit, gitBranch, __dirname)
} else {
console.log(
Red(`cobalt wasn't configured yet or configuration is invalid.\n`)