correct-apricot•2y ago
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
correct-apricotOP•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 classThis seems to work
correct-apricotOP•2y ago
Thanks a lot Lukas! That's indeed what I was looking for
@Mike just advanced to level 1! Thanks for your contributions! 🎉