22 lines
764 B
TypeScript
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(); |