CA
Crawlee & Apify•3y ago
equal-aqua

how to create a function that can be called from the router?

I just want to segment the code in small functions. Below code not work because type is not recoqnized.
No description
2 Replies
harsh-harlequin
harsh-harlequin•3y ago
Can you share more code or description of what you are trying to do? If you want to add it as a route handler, it has to have the type that is use with router.addHandler(routeName, handler)
equal-aqua
equal-aquaOP•3y ago
Hi Lukas. Sorry for the slow reply, I did not get a notification. I have a route handler and from within that I want to call my function, which is what I am having trouble with in order to break down the code into functions rather than placing everything in the route handler. I will share a code snippet soon. Let us discuss this in the new year until then have a nice Christmas 🙂

Did you find this page helpful?