14 lines
522 B
TypeScript
14 lines
522 B
TypeScript
import { readFixture } from './fixture.js';
|
|
import { config } from '../src/config.js';
|
|
import { createHosted } from '../src/hosted.js';
|
|
const fixture = readFixture();
|
|
const settings = config({ ...process.env, ...fixture.env });
|
|
const hosted = await createHosted(settings);
|
|
const listener = hosted.app.listen(settings.PORT, '127.0.0.1', () =>
|
|
process.stdout.write('Retained fixture server ready.\n'),
|
|
);
|
|
process.once('SIGTERM', () =>
|
|
listener.close(() => {
|
|
void hosted.close().then(() => process.exit(0));
|
|
}),
|
|
);
|