Fix homepage API 500 by using axios baseURL and stable paginate.
deploy to danak / build_and_deploy (push) Has been cancelled
deploy to danak / build_and_deploy (push) Has been cancelled
Replace self-proxy with direct SSR baseURL, rewrite blog post pagination with async/await, pin mongoose-paginate-v2, and add API error logging. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -25,6 +25,14 @@ app.use('/public', Public)
|
||||
app.use('/auth', auth)
|
||||
app.use('/admin', isAdmin, admin)
|
||||
|
||||
app.get('/health', (req, res) => {
|
||||
res.json({ ok: true })
|
||||
})
|
||||
|
||||
app.use((err, req, res, next) => {
|
||||
console.error('Express error:', req.method, req.originalUrl, err?.message || err)
|
||||
res.status(500).json({ message: err?.message || 'Internal Server Error' })
|
||||
})
|
||||
|
||||
// Export the server middleware
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user