From 3d84a34c5cf608a600a7483c2a849a71fa3722bd Mon Sep 17 00:00:00 2001 From: Aurelsicoko Date: Wed, 11 Oct 2017 14:47:04 +0200 Subject: [PATCH] Harmonize response guides and add more details on Boom access --- docs/3.x.x/en/guides/responses.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/3.x.x/en/guides/responses.md b/docs/3.x.x/en/guides/responses.md index 5cadffd784..52a265689f 100644 --- a/docs/3.x.x/en/guides/responses.md +++ b/docs/3.x.x/en/guides/responses.md @@ -2,14 +2,14 @@ See the [responses concepts](../concepts/concepts.md#responses) for details. -## Context Response - -The context object (`ctx`) contains a list of values and functions useful to manage server responses. They are accessible through `ctx.response`, from [controllers](controllers.md) and [policies](policies.md). - ### API Reference For more information, please refer to the [Koa response documentation](http://koajs.com/#response). +## Context Response + +The context object (`ctx`) contains a list of values and functions useful to manage server responses. They are accessible through `ctx.response`, from [controllers](controllers.md) and [policies](policies.md). + #### response.header Response header object. @@ -635,6 +635,8 @@ Strapi integrates [Boom](https://github.com/hapijs/boom): a set of utilities for You can also override responses based on them status. Please read the [configuration responses](../configurations/configurations.md#responses) for that. +> Note: Every Boom's functions is delegated to the context. It means that `ctx.notFound` is a shortcut to `ctx.response.notFound`. + ### API Reference For more information, please refer to the [Boom documentation](https://github.com/hapijs/boom).