Crawlee Router as a folder with different files for each Handler
Hey, everyone! 👋
Is it possible to create a folder named
routes
in my project and then construct export const router
in index.ts
file by adding all my handlers from different files?
Like this
And if this is possible, what should be the type of the handler in a separate file?4 Replies
rival-blackOP•2y ago
From the sources, I've understood that handler should have type
but is it possible to use this type or any alias in my own files?
Because it seems that
Context
is defined as a type parameter of the Router
classdeep-jade•17mo ago
This seems to work
rival-blackOP•17mo ago
Thanks a lot Lukas! That's indeed what I was looking for
@Mike just advanced to level 1! Thanks for your contributions! 🎉