rest-hapi
rest-hapi copied to clipboard
Support a collection in the modelPath config property
The configuration have a property to customize the models route:
config.modelPath = 'models';
This is a single path directory so all the models must be inside. It would be great if I could set up a collection of files instead of a single directory
For example, I have the next project tree:
myProject/
|- index.js
|- server.js
|- config/
|- modules/
|- users_module/
|- handlers/
|- models/
|- user.model.js
|- article_module/
|- handlers/
|- models/
|- article.model.js
And my config would be:
config.modelPath = ['modules/users_module/models/user.model', 'modules/article_module/models/article.model']';
This feature can be very useful to support a large projects with modular directory structure, like the above example.