0👍
you need to add this in your server/index.js or server/app.js basically wherever you create your express instance
// Create express router
const router = express.Router()
// Transform req & res to have the same API as express
// So we can use res.status() & res.json()
router.use((req, res, next) => {
Object.setPrototypeOf(req, app.request)
Object.setPrototypeOf(res, app.response)
req.res = res
res.req = req
next()
})
- [Vuejs]-Laravel backend to Vue not displaying correctly sorted data
- [Vuejs]-Vue.js show answer after submit
Source:stackexchange.com