33 lines
1.3 KiB
JavaScript
33 lines
1.3 KiB
JavaScript
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
});
|
|
}
|
|
return path;
|
|
};
|
|
await import('reflect-metadata');
|
|
const { Ignitor, prettyPrintError } = await import('@adonisjs/core');
|
|
const APP_ROOT = new URL('../', import.meta.url);
|
|
const IMPORTER = (filePath) => {
|
|
if (filePath.startsWith('./') || filePath.startsWith('../')) {
|
|
return import(__rewriteRelativeImportExtension(new URL(filePath, APP_ROOT).href));
|
|
}
|
|
return import(__rewriteRelativeImportExtension(filePath));
|
|
};
|
|
new Ignitor(APP_ROOT, { importer: IMPORTER })
|
|
.tap((app) => {
|
|
app.booting(async () => {
|
|
await import('#start/env');
|
|
});
|
|
app.listen('SIGTERM', () => app.terminate());
|
|
app.listenIf(app.managedByPm2, 'SIGINT', () => app.terminate());
|
|
})
|
|
.httpServer()
|
|
.start()
|
|
.catch((error) => {
|
|
process.exitCode = 1;
|
|
prettyPrintError(error);
|
|
});
|
|
export {};
|
|
//# sourceMappingURL=server.js.map
|