26 lines
516 B
TypeScript
26 lines
516 B
TypeScript
import './lib/console.ts'
|
|
import stream from './lib/pino_transport_console.ts'
|
|
import env from './env.ts'
|
|
import Server from './server.ts'
|
|
|
|
const server = await Server({
|
|
logger: {
|
|
level: env.LOG_LEVEL,
|
|
stream,
|
|
serializers: stream && {
|
|
req: (req) => ({
|
|
method: req.method,
|
|
url: req.url,
|
|
headers: req.headers,
|
|
ip: req.ip,
|
|
}),
|
|
},
|
|
},
|
|
})
|
|
|
|
try {
|
|
await server.listen({ port: env.FASTIFY_PORT, host: env.FASTIFY_HOST })
|
|
} catch (e) {
|
|
server.log.error(e)
|
|
}
|