1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/src/server-dev.ts

41 lines
1.2 KiB
TypeScript
Raw Normal View History

import unleash from './lib/server-impl';
import { createConfig } from './lib/create-config';
2021-04-23 15:31:12 +02:00
import { LogLevel } from './lib/logger';
process.nextTick(async () => {
try {
await unleash.start(
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,
},
}),
);
} 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);