mirror of
https://github.com/tornadocash/tornado-relayer.git
synced 2024-10-01 08:25:37 -04:00
cors
This commit is contained in:
parent
38e4f74afb
commit
52cfb10ea1
7
index.js
7
index.js
@ -4,6 +4,11 @@ const express = require('express')
|
||||
|
||||
const app = express()
|
||||
app.use(express.json())
|
||||
app.use(function(req, res, next) {
|
||||
res.header("Access-Control-Allow-Origin", "*"); // update to match the domain you will make the request from
|
||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||
next();
|
||||
});
|
||||
|
||||
const { netId, rpcUrl, privateKey, mixerAddress, defaultGasPrice } = require('./config')
|
||||
const { fetchGasPrice, isValidProof } = require('./utils')
|
||||
@ -54,7 +59,7 @@ app.post('/relay', async (req, resp) => {
|
||||
// TODO: nonce
|
||||
})
|
||||
result.once('transactionHash', function(hash){
|
||||
resp.send({ transaction: hash })
|
||||
resp.json({ txHash: hash })
|
||||
}).on('error', function(e){
|
||||
console.log(e)
|
||||
resp.status(400).send('Proof is malformed')
|
||||
|
Loading…
Reference in New Issue
Block a user