-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declarative pattern for response codes #186
Milestone
Comments
Yeah this sounds good... It belongs in the |
Another option to consider: annotate a callback argument as holding the HTTP status code function foo(cb) {
cb(null, 299);
}
foo.returns = {
arg: 'httpStatusCode', http: { target: 'statusCode' }
} |
Released as v2.19.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In order to return a custom non-error response code, you must implement an afterRemoting hook. The following is an example of an endpoint returning a status of 299.
We request a more declarative approach. Something like:
returns: { status: 299, root: true }
ref: PLATAPI-234
This would be the mechanism for implementing strongloop/loopback#360
The text was updated successfully, but these errors were encountered: