Adding intermediate paths to Netlify function routes?

We’re hoping to migrate our current FaaS backend to Netlify. Currently, our api routes are as follows:

For example, /api/Auth/RegisterUser

With Netlify, I’ve gone through all the docs and the forum, but I can’t figure out if it’s possible to do something similar without adding redirects or middleware in JS, which I really want to avoid.

We have > 150 functions, so it would be a dealbreaker if there was no way to organize them into subfolders/subcategories…

Plus we would need to update all the routes throughout our app, which we’re also hoping to avoid :slight_smile:

Thanks in advance for anyone with any ideas!

hi there daniel, thanks for checking in! sounds like an interesting app you are trying to build and of course we’d love to see if we can make this work on netlify.

i am going to ask someone who knows more about functions and redirects to weigh in here and see if we can solve your problem!

I received a response from support, which I am re-posting here for the community’s benefit:

Sorry to have a bad news, but the only way to achieve what you need is by using middlewares. There’s no way to organise functions in a folder structure at the moment.

If anyone has any bright ideas about how to handle routing easily, I’m all ears! :slight_smile:

1 Like