#ryan-webhooks

1 messages · Page 1 of 1 (latest)

slender cobalt
#

hello! I just noticed you pasted screenshots, but what is your question?

swift iris
#

Hello! In my server.js I import a few files that contain routes. For context, I'm taking this project over from someone who couldn't get that to work, so he put everything into one giant file.

The thing that throws me off is that the webhook api requires data in express.raw() format, but all other routes in the app require express.json(). The issue is, if I import Webhooks first in server.js, it works, but other routes don't. If I import other routes first, they work but Webhooks don't.

I am cautiously optimistic that I solved it though...the non-webhook route file had so many routes, that importing it required I do app.use("/", companyRoutes). While there would be a more exact match lower down, I think the express router was just following the first potential match, then applying that middleware, then not finding the route and failing on me