Bladeren bron

Changed app.listen() for testing to deployment

Fixing-CORS-crash
BinHong Lee 7 jaren geleden
bovenliggende
commit
ddc5b4589e
1 gewijzigde bestanden met toevoegingen van 7 en 7 verwijderingen
  1. +7
    -7
      index.js

+ 7
- 7
index.js Bestand weergeven

@@ -7,17 +7,17 @@ var MIXMAX_API_KEY
var app = express() var app = express()
var input var input


app.use(bodyParser.json({
limit: '100mb',
type: 'application/json'
}))

app.use(function (req, res, next) { app.use(function (req, res, next) {
res.header('Access-Control-Allow-Origin', '*') res.header('Access-Control-Allow-Origin', '*')
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept') res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept')
next() next()
}) })


app.use(bodyParser.json({
limit: '100mb',
type: 'application/json'
}))

app.get('/help', function (req, res) { app.get('/help', function (req, res) {
res.send('https://github.com/binhonglee/Breakups') res.send('https://github.com/binhonglee/Breakups')
}) })
@@ -67,8 +67,8 @@ app.post('/emailPaymentChain', function (req, res) {
res.json(emails) res.json(emails)
}) })


app.listen(5000)
// app.listen(process.env.PORT)
// app.listen(5000)
app.listen(process.env.PORT)


function total (input) { function total (input) {
var total = 0 var total = 0


Laden…
Annuleren
Opslaan