> For the complete documentation index, see [llms.txt](https://stricjs.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stricjs.gitbook.io/docs/basic/quick-response.md).

# Quick response

Sending response that will never change

```typescript
import { Router, macro } from '@stricjs/router';
import { response } from '@stricjs/utils';

// Cache the payload and the response options
const badReq = response('Bad request', { status: 400 });

// The response payload can be anything that is serializable to a string 
// That means you can put a number, string, boolean, null, undefined, arrays
// and objects as response payload (it will convert the payload to string)
// It does not work with Buffer, ArrayBuffer, typed arrays and streams

export default new Router()
    .get('/', macro(() => new Response('Hi')))
    // For other methods return a bad request
    .all('/', badReq);
```
