mirror of
https://github.com/tornadocash/tornado-relayer
synced 2024-02-02 15:04:06 +01:00
invalid JSON error handling
This commit is contained in:
parent
918c5b0f7a
commit
91c109b902
10
index.js
10
index.js
@ -4,6 +4,16 @@ const express = require('express')
|
||||
|
||||
const app = express()
|
||||
app.use(express.json())
|
||||
|
||||
app.use((err, req, res, next) => {
|
||||
if (err) {
|
||||
console.log('Invalid Request data')
|
||||
res.send('Invalid Request data')
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
||||
app.use(function(req, res, next) {
|
||||
res.header('Access-Control-Allow-Origin', '*')
|
||||
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept')
|
||||
|
Loading…
Reference in New Issue
Block a user