1 | import { getRootLogger } from '@backstage/backend-common';
|
2 | import yn from 'yn';
|
3 | import { startStandaloneServer } from './service/standaloneServer';
|
4 |
|
5 | const port = process.env.PLUGIN_PORT ? Number(process.env.PLUGIN_PORT) : 7007;
|
6 | const enableCors = yn(process.env.PLUGIN_CORS, { default: false });
|
7 | const logger = getRootLogger();
|
8 |
|
9 | startStandaloneServer({ port, enableCors, logger }).catch(err => {
|
10 | logger.error(err);
|
11 | process.exit(1);
|
12 | });
|
13 |
|
14 | process.on('SIGINT', () => {
|
15 | logger.info('CTRL+C pressed; exiting.');
|
16 | process.exit(0);
|
17 | });
|
18 |
|
\ | No newline at end of file |