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