Skip to content

200 OK

The classic success code. Everything went perfectly. For GET requests, you get your data. For POST/PUT, the action succeeded.

This is your bread and butter. Use it whenever a standard request works perfectly. For a GET, return the data. For a POST/PUT, return the updated object.

import { HttpCode, get } from 'shokupan';
export const getResource = get('/resource', () => {
return { message: 'OK' };
}).pipe(HttpCode(200));