fixed small issues
This commit is contained in:
parent
be9f5ad33a
commit
782e13cd63
3 changed files with 9 additions and 22 deletions
|
|
@ -5,6 +5,8 @@ apis:
|
||||||
root: ./user/openapi.json
|
root: ./user/openapi.json
|
||||||
chat:
|
chat:
|
||||||
root: ./chat/openapi.json
|
root: ./chat/openapi.json
|
||||||
|
ttt:
|
||||||
|
root: ./tic-tac-toe/openapi.json
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
info-license: warn
|
info-license: warn
|
||||||
|
|
|
||||||
|
|
@ -4,33 +4,18 @@ import fastify, { FastifyInstance } from 'fastify';
|
||||||
import app from './app';
|
import app from './app';
|
||||||
|
|
||||||
const start = async () => {
|
const start = async () => {
|
||||||
const envToLogger = {
|
const f: FastifyInstance = fastify({ logger: { level: 'info' } });
|
||||||
development: {
|
process.on('SIGTERM', () => {
|
||||||
// transport: {
|
f.log.warn('Requested to shutdown');
|
||||||
// target: 'pino',
|
process.exit(134);
|
||||||
// options: {
|
});
|
||||||
// translateTime: 'HH:MM:ss Z',
|
|
||||||
// ignore: 'pid,hostname',
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
production: true,
|
|
||||||
test: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
const f: FastifyInstance = fastify({ logger: envToLogger.development });
|
|
||||||
try {
|
try {
|
||||||
process.on('SIGTERM', () => {
|
|
||||||
f.log.info('Requested to shutdown');
|
|
||||||
process.exit(134);
|
|
||||||
});
|
|
||||||
console.log('-------->Serving static files from:');
|
|
||||||
await f.register(app, {});
|
await f.register(app, {});
|
||||||
await f.listen({ port: 80, host: '0.0.0.0' });
|
await f.listen({ port: 80, host: '0.0.0.0' });
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
f.log.error(err);
|
f.log.error(err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
start();
|
start();
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ const externals = collectDeps(
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
root: __dirname,
|
root: __dirname,
|
||||||
define: {
|
define: {
|
||||||
__SERVICE_NAME: '"tic-tac-toe"',
|
__SERVICE_NAME: '"ttt"',
|
||||||
},
|
},
|
||||||
// service root
|
// service root
|
||||||
plugins: [tsconfigPaths(), nodeExternals()],
|
plugins: [tsconfigPaths(), nodeExternals()],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue