Howard86 / next-api-handler

lightweight nextjs api handler wrapper, portable & configurable for serverless environment
https://next-api-handler.vercel.app
Other
50 stars 1 forks source link

How to respond with "data" directly? #67

Closed caioedut closed 1 year ago

caioedut commented 1 year ago

I just don't want props "success"/"error" and data on my response.

Howard86 commented 1 year ago

following https://github.com/Howard86/next-api-handler/blob/main/src/lib/router-builder.ts#L88-L91

  res.status(200).json({
    success: true,
    data,
  });

atm we cannot update response format from router-builder

ideally we should have a response dto that we can customise the response