You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
694 B
23 lines
694 B
import Fastify from 'fastify' |
|
import cors from '@fastify/cors' |
|
import init from './configuration/logger.config.js' |
|
import corsConfig from './configuration/cors.config.js' |
|
import serverConfig from './configuration/server.config.js' |
|
import healthRoutes from './routes/health.routes.js' |
|
import publicRoutes from './routes/public.routes.js' |
|
import suiviRoutes from './routes/suivi.routes.js' |
|
|
|
const app = Fastify({ logger: init('SuiviLootWow-server') }) |
|
|
|
app.register(cors, corsConfig) |
|
|
|
app.register(healthRoutes) |
|
app.register(publicRoutes) |
|
app.register(suiviRoutes) |
|
|
|
app.listen({ port: serverConfig.port, host: '0.0.0.0' }, (err) => { |
|
if (err) { |
|
app.log.error(err) |
|
process.exit(1) |
|
} |
|
}) |