galactic-bot/index.ts
Navy.gif e44eb8435e Typescript translation WIP
Co-authored-by: D3vision <info@d3vision.dev>
2023-12-03 22:12:01 +02:00

22 lines
764 B
TypeScript

// require('dotenv').config({ override: true });
import { config } from 'dotenv';
config({ override: true });
// eslint-disable-next-line no-console
console.log(`Starting in ${process.env.NODE_ENV} mode`);
import Controller from './src/middleware/Controller.js';
import { readFileSync } from 'node:fs';
import path from 'node:path';
const rawOptions = readFileSync('./options.json', { encoding: 'utf-8' });
const options = JSON.parse(rawOptions);
// const { version } = require('./package.json');
const rawPackage = readFileSync('./package.json', { encoding: 'utf-8' });
const pkg = JSON.parse(rawPackage);
const { version } = pkg;
const srcDir = path.join(process.cwd(), 'build', 'src');
options.srcDir = srcDir;
new Controller(options, version)
.build();