Use "send" instead of "end" at end of requests
This is so that they show as pages and the browser doesn't try to download them instead.
This commit is contained in:
parent
349d9ae8a4
commit
680c3cf278
1 changed files with 3 additions and 3 deletions
|
@ -149,7 +149,7 @@ router.post('/pledge', async (req, res) => {
|
||||||
let messages = req.body.messages
|
let messages = req.body.messages
|
||||||
|
|
||||||
if (!!errors.length) {
|
if (!!errors.length) {
|
||||||
res.end(`Errors: ${'' + errors}`)
|
res.send(`Errors: ${'' + errors}`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,11 +170,11 @@ router.post('/pledge', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
await pledge.save()
|
await pledge.save()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
res.end("Sorry, something went wrong while saving your pledge and we don't know what 🙁. Please try again...")
|
res.send("Sorry, something went wrong while saving your pledge and we don't know what 🙁. Please try again...")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
res.end("Thank you! We're still working on setting up this website, so as you can see this page doesn't look great at the moment, but we will be sending you a confirmation email in a few days. Watch out for an email from editors@snipettemag.com, and if it doesn't reach, check your spam box :P")
|
res.send("Thank you! We're still working on setting up this website, so as you can see this page doesn't look great at the moment, but we will be sending you a confirmation email in a few days. Watch out for an email from editors@snipettemag.com, and if it doesn't reach, check your spam box :P")
|
||||||
})
|
})
|
||||||
|
|
||||||
router.use(express.static('dist'))
|
router.use(express.static('dist'))
|
||||||
|
|
Loading…
Reference in a new issue