- server - Node application scripts and configuration files.
- client - Client JavaScript, HTML, and CSS files.
- common - Files common to client and server. The /models sub-directory contains all model JSON and JavaScript files.
-
server.js: Main application program file.
-
config.json: Application settings.
app.get('option-name') -
datasources.json: Data source configuration file.
app.datasources['datasource-name'] -
model-config.json: Model configuration file. LoopBack applications use the model-config.json file to link models to data sources
-
middleware.json: Middleware definition file.
-
/boot directory: Add scripts to perform initialization and setup. Scripts are automatically executed in alphabetical order.
/models directory:
- Custom model files: Model definitions, by convention named modelName.json.
- Custom model scripts by convention named modelName.js.
myModel = app.models.myModelName
Actually, LoopBack creates several other built-in models for common use cases:
- Application model - contains metadata for a client application that has its own identity and associated configuration with the LoopBack server.
- User model - register and authenticate users of your app locally or against third-party services.
- Access control models - ACL, AccessToken, Scope, Role, and * RoleMapping models for controlling access to applications, resources, and methods.
- Email model - send emails to your app users using SMTP or third-party services.