Observed since 20 Oct, 19:58 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
An Express middleware that refuses to brew coffee (HTTP 418).
A lightweight, fun Express.js middleware that strictly enforces RFC 2324 by refusing to brew coffee.
If a route using this middleware is hit, the server will immediately respond with the classic HTTP 418 "I'm a teapot" status code and message.
You can install this package using npm:
npm install 418-teapot
(Note: express is required as a peer dependency.)
Simply import the middleware and apply it to any Express route where coffee brewing is strictly prohibited.
const express = require('express');
const teapot = require('418-teapot');
const app = express();
const PORT = 3000;
// Apply the teapot middleware to the coffee route
app.get('/coffee', teapot.middleware);
app.listen(PORT, '0.0.0.0', () => {
console.log(`Server is running on port ${PORT}!`);
});
When a client makes a GET request to /coffee, they will receive an HTTP 418 status code along with the following JSON response:
{
"code": 418,
"message": "I'm a teapot",
"description": "The server refuses to brew coffee because it is, permanently, a teapot."
}
The module exports the middleware function alongside the raw HTTP 418 data object, giving you flexibility in how you use it.
const teapot = require('418-teapot');
console.log(teapot.code);
// Returns: 418
console.log(teapot.message);
// Returns: "I'm a teapot"
console.log(teapot.description);
// Returns: "The server refuses to brew coffee because it is, permanently, a teapot."
This project is licensed under the MIT License.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.0Registry latest | 22 Jun 2026 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 19:58 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:00c639f80578f5d5f7e0fe12865a495ce9b433a522345aae763f8796730eeb17