implemented esbuild and cleaned up stuff

cobalt should now load even faster
This commit is contained in:
wukko
2022-07-30 15:01:54 +06:00
parent f6b0894def
commit 22c16b2fc8
36 changed files with 31 additions and 70 deletions

View File

@@ -13,6 +13,7 @@ import { apiJSON, languageCode } from "./modules/sub/utils.js";
import { Bright, Cyan } from "./modules/sub/consoleText.js";
import stream from "./modules/stream/stream.js";
import loc from "./localization/manager.js";
import { buildFront } from "./modules/build.js";
const commitHash = shortCommit();
const app = express();
@@ -39,9 +40,11 @@ if (fs.existsSync('./.env')) {
}
})
await buildFront();
app.use('/api/', apiLimiter);
app.use('/api/stream', apiLimiterStream);
app.use('/', express.static('./src/static'));
app.use('/', express.static('./min'));
app.use('/', express.static('./src/front'));
app.use((req, res, next) => {
try {