I can’t submit forms and newsletters on the vercel site which seems to work fine on localhost with no errors and updates to the mongoDB websites online.
Error on clicking the buttons:
mail-script.js:116
(2) POST https://ihype.vercel.app/api/getMsgIp 404 (Not Found)
It works fine on localhost with no errors, but not on the vercel site: Ihype Company | HypeReach, Contact Us
my routes:
app.post('/api/getIp', async (req, res) => {
await main(
(func = 'limitFindMany'),
(database = 'ihypeBeta'),
(collection = 'betaNewsTesters'),
(data = req.body),
(limit = 1)
)
.catch(console.error)
.then(() => {
if (array[0] !== undefined && array[0] !== null) {
res.json({
present: true,
data: array[0],
})
} else {
res.json({
present: false,
})
}
})
})
app.post('/api/getMsgIp', async (req, res) => {
await main(
(func = 'limitFindMany'),
(database = 'ihypeBeta'),
(collection = 'betaTesters'),
(data = req.body),
(limit = 1)
)
.catch(console.error)
.then(() => {
if (array[0] !== undefined && array[0] !== null) {
res.json({
present: true,
data: array[0],
})
} else {
res.json({
present: false,
})
}
})
})
HTML, CSS, JAVASCRIPT, NODEJS, EXPRESS, MONGODB