Closed c0ncentus closed 3 years ago
Foal is not designed to be used that way (i.e. using a global object to define the routes and their permissions). You have to use controllers with hooks.
There are two things however that could probably reduce the code size:
Hi,
I want make config file for every endpoints because i don't want waste time to do x times the same file with unless code [...]
"one config file to rule them all" in config.ts
each endpoint are very classic ... nothing change.
or
ps: 8 files for one object ... if I have 20 ententies then it generates 8* 20 routes = 20 annoying files or 160 on one config. "annoying" because sometimes it is very very basic need. More you write, more you duplicate more errors occured and more tests is required so ... with this config everything is "less required".
here you can generate swagger and log in the console all routes of the app.
Tests is not longer verify the endpoint but if it generate well.
I already do this with older version express but with this new version some dummy error occur with Express and so it's why I using FoalTs now. I wish have a backend without do lot of things that users can't see.
PS: Yes Search can be dynamic with request body !