-
Notifications
You must be signed in to change notification settings - Fork 0
FAQ
Heath Morrison edited this page Dec 9, 2015
·
6 revisions
Q: I've changed the Loopback
restApiRootproperty to/and now my custom routes (Passport auth routes, or other Express middleware routes) aren't working!
A: Ensure that your custom routes are initializing before loopback.rest (which initializes by default in a boot script). Loopback will throw back a 404 for invalid routes like /api/InvalidModel. It doesn’t allow for fallback to later routes.
Q. My model.js file has become large and unwieldy. How can I split it into separate files?
A: See the following gist: https://gist.github.com/doublemarked/7658a16d0f8f6420df8e
Q: How can I create a property that behaves like an enum?
A: Use a String property validated with validatesInclusionOf. For example,
User.validatesInclusionOf('gender', {in: ['male', 'female']});