This method is used to send a 200 ("OK") response back down to the client.
Like the other built-in custom response modules, the behavior of this method is customizable.
By default, it works as follows:
dataas JSON. If no
datais provided a default response body will be sent (the string
- This method is terminal, meaning it is generally the last line of code your app should run for a given request (hence the advisory usage of
returnthroughout these docs).
res.ok()(like other userland response methods) can be overridden or modified. It runs the response method defined in
api/responses/ok.js. If an
ok.jsresponse method does not exist in your app, Sails will implicitly use the default behavior.