session destroy fixed
This commit is contained in:
+4
-4
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user