From 585156f30118ce98d78c339dbf5cba69028da3a7 Mon Sep 17 00:00:00 2001 From: lesion Date: Mon, 23 May 2022 14:42:15 +0200 Subject: [PATCH] place api --- server/routes.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/server/routes.js b/server/routes.js index c6d80237..87a2c752 100644 --- a/server/routes.js +++ b/server/routes.js @@ -1,9 +1,8 @@ const express = require('express') const cookieParser = require('cookie-parser') - const initialize = require('./initialize.server') -initialize() +initialize.start() // const metricsController = require('./metrics') // const promBundle = require('express-prom-bundle') @@ -79,4 +78,16 @@ app.use(async (req, res, next) => { next() }) -module.exports = app +module.exports = { + handler: app, + load () { + console.error('dentro load !') + }, + unload: initialize.shutdown + // async unload () { + // const db = require('./api/models/index') + // await db.close() + // process.off('SIGTERM') + // process.off('SIGINT') + // } +}