418 I'm a teapot
An April Fool’s joke from 1998 indicating the server is a teapot and cannot brew coffee.
When and Why to Use It
Section titled “When and Why to Use It”Do not use this unless you are building an easter egg. It’s an April Fools’ joke.
Usage Examples
Section titled “Usage Examples”import { HttpException, get } from 'shokupan';
export const getResource = get('/resource', () => { throw new HttpException('I\'m a teapot', 418);});import { Controller, Get, HttpException } from 'shokupan';
@Controller('/api')export class ExampleController { @Get('/resource') getResource() { throw new HttpException('I\'m a teapot', 418); }}import express from 'express';const app = express();
app.get('/resource', (req, res) => { res.status(418).json({ error: 'I\'m a teapot' });});import { Controller, Get, HttpException } from '@nestjs/common';
@Controller('api')export class ExampleController { @Get('resource') getResource() { throw new HttpException('I\'m a teapot', 418); }}import Koa from 'koa';const app = new Koa();
app.use(async ctx => { if (ctx.path === '/resource' && ctx.method === 'GET') { ctx.status = 418; ctx.body = { error: 'I\'m a teapot' }; }});