2021-08-13 19:22:15 +02:00
|
|
|
import { start } from './lib/server-impl';
|
2021-04-22 15:04:08 +02:00
|
|
|
import { createConfig } from './lib/create-config';
|
2021-04-23 15:31:12 +02:00
|
|
|
import { LogLevel } from './lib/logger';
|
2020-04-13 22:38:46 +02:00
|
|
|
|
2021-06-17 20:33:34 +02:00
|
|
|
process.nextTick(async () => {
|
|
|
|
try {
|
2021-08-13 19:22:15 +02:00
|
|
|
await start(
|
2021-06-17 20:33:34 +02:00
|
|
|
createConfig({
|
|
|
|
db: {
|
|
|
|
user: 'unleash_user',
|
|
|
|
password: 'passord',
|
|
|
|
host: 'localhost',
|
|
|
|
port: 5432,
|
|
|
|
database: 'unleash',
|
|
|
|
ssl: false,
|
|
|
|
},
|
|
|
|
server: {
|
|
|
|
enableRequestLogger: true,
|
|
|
|
baseUriPath: '',
|
|
|
|
// keepAliveTimeout: 1,
|
|
|
|
gracefulShutdownEnable: true,
|
|
|
|
},
|
|
|
|
logLevel: LogLevel.debug,
|
|
|
|
enableOAS: true,
|
|
|
|
versionCheck: {
|
|
|
|
enable: false,
|
|
|
|
},
|
2021-10-08 10:09:22 +02:00
|
|
|
experimental: {
|
|
|
|
metricsV2: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
2021-06-17 20:33:34 +02:00
|
|
|
}),
|
|
|
|
);
|
|
|
|
} catch (error) {
|
|
|
|
if (error.code === 'EADDRINUSE') {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.warn('Port in use. You might want to reload once more.');
|
|
|
|
} else {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.error(error);
|
|
|
|
process.exit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, 0);
|