session destroy fixed

This commit is contained in:
C
2022-12-29 16:16:19 +05:00
parent 61b35128f4
commit b11e2536cb
13 changed files with 146 additions and 64 deletions
+4 -4
View File
@@ -29,7 +29,7 @@ app.use(function(req, res, next) {
// CORS
app.options(function(req, res) {
//'GET, POST, OPTIONS, PUT, PATCH, DELETE'
res.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS')
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET, POST')
res.end()
})
@@ -50,7 +50,7 @@ app.use(routes)
app.use(function(error, req, res, next) {
// errors
logger_runtime.error(error)
res.send(error.message)
res.status(400).json({type:'error', content:error.message})
next()
})
@@ -60,8 +60,8 @@ app.use(function(req, res, next) {
// start listen server
try {
app.listen(config.port, config.ip)
logger_init.log(`Listening at http://${config.ip}:${config.port}`)
app.listen(config.port)
logger_init.log(`Listening at http://localhost:${config.port}`)
} catch (e) {
return logger_init.error(e)
}