What is the different between common and server model in loopback?
If you want to be able to share models between client and server parts of your app, put your model JSON and JavaScript files in the /common/models directory. If you want to have separate client and server models, then put your model JSON and JavaScript files in the /server/models directory.
Refer this link. https://docs.strongloop.com/display/public/LB/common+directory
Why loopback suggest to keep common/models always ?
Keep, the default, common, even though in this application you'll only be working with server-side models
common directory
Edit this page
The /common directory contains files shared by the server and client parts of the application. When you create models that are shared by client and server, the Application generator creates a
/models
sub-directory with one JSON file per model in the application. See Model definition JSON file for a description of the format of this file.
0 pensamientos:
Post a Comment
feedback!