You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to migrate a hapi.js application from v16.4.3 to ^20.0.1.
Since there are major changes made in v17.0.0 including reply() interface upgradation. Is there any optimal way to replace return reply() to return reply.reponse() in all the handlers?
//working code with version v16.4.3(Hapi)constaddFoo={description: 'add foo data',notes: 'add foo data',tags: ['api','FooCondition'],validate: {payload: {id: joi.number().required(),},},handler: (req,res)=>{returnmaindb.subcategorymaster.findAll({where: {'id': req.payload.id}}).then((result)=>{res(result);}).catch((DBException)=>{res(DBException.message);});}};// Wanted to migrate to below code without making manual change at each and every handler.//working code with version v20.0.1(Hapi)constaddFoo={description: 'add foo data',notes: 'add foo data',tags: ['api','FooCondition'],validate: {payload: {id: joi.number().required(),},},handler: (req,res)=>{returnmaindb.subcategorymaster.findAll({where: {'id': req.payload.id}}).then((result)=>{returnres.response(result);}).catch((DBException)=>{returnres.response(DBException.message);});}};
The text was updated successfully, but these errors were encountered:
For major releases we have detailed migration explanations in GitHub issues labelled with "Breaking changes" and "Release notes" labels. Here are the one you'll need to go through considering your starting point and the destination version:
I don't think there is an automated or quick way for you to move from v16 API to v17+ API as the move to async/await kind of impacted the way you write your handlers.
I'll close this issue but we can keep the discussion going if needed.
Runtime
Node.js
Runtime version
v16.20.2
Module version
^20.0.1
Used with
Hapi application
Any other relevant information
No response
How can we help?
I need to migrate a hapi.js application from v16.4.3 to ^20.0.1.
Since there are major changes made in v17.0.0 including reply() interface upgradation. Is there any optimal way to replace
return reply()
toreturn reply.reponse()
in all the handlers?The text was updated successfully, but these errors were encountered: