Security header middleware collection for Koa applications that wraps Helmet.js
91
Build a simple Koa web API that serves information about books and implements proper referrer policy headers to control how much referrer information is shared when users navigate to external resources.
Your API should:
GET /books that returns a JSON array of book objects (at least 2 books with title and author fields)GET /books/:id that returns a single book by ID (numeric ID)/books returns status 200 with a JSON array containing at least 2 books @test/books/1 returns status 200 with a single book object @test/books/999 returns status 404 for a non-existent book @testReferrer-Policy set to no-referrer @test@generates
// Export the Koa application instance
export const app;
// Export a function to start the server
export function startServer(port);Provides security headers middleware including referrer policy control.
Web framework for building the API.
Routing middleware for handling different endpoints.
Install with Tessl CLI
npx tessl i tessl/npm-koa-helmetdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10