mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-02 01:13:26 +00:00
chore: setup script
This commit is contained in:
30
apps/edr-freight-api/src/scripts/main.ts
Normal file
30
apps/edr-freight-api/src/scripts/main.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import "reflect-metadata";
|
||||
import { config } from "dotenv";
|
||||
|
||||
config();
|
||||
|
||||
import Vorpal from "vorpal";
|
||||
import { registerCommands } from "./cmds/index";
|
||||
|
||||
import { NestFactory } from "@nestjs/core";
|
||||
import { AppModule } from "../app.module";
|
||||
|
||||
const vorpal = new Vorpal();
|
||||
|
||||
async function main() {
|
||||
const app = await NestFactory.createApplicationContext(AppModule, {
|
||||
logger: false,
|
||||
});
|
||||
|
||||
try {
|
||||
registerCommands(vorpal, { app });
|
||||
vorpal.parse(process.argv);
|
||||
} finally {
|
||||
await app.close();
|
||||
}
|
||||
}
|
||||
|
||||
main().catch((err) => {
|
||||
console.error("Script failed:", err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user