Make yarn dev for backends respect the PLUGIN_PORT env var

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-06-14 09:54:46 +02:00
parent fdefd713b2
commit 3108ff7bfd
11 changed files with 79 additions and 17 deletions
@@ -88,9 +88,12 @@ export async function startStandaloneServer(
config,
discovery,
});
const service = createServiceBuilder(module)
.enableCors({ origin: 'http://localhost:3000' })
let service = createServiceBuilder(module)
.setPort(options.port)
.addRouter('/techdocs', router);
if (options.enableCors) {
service = service.enableCors({ origin: 'http://localhost:3000' });
}
return await service.start().catch(err => {
logger.error(err);
process.exit(1);