Security header middleware collection for Koa applications that wraps Helmet.js
91
Build a basic Koa web server that serves a REST API with proper security headers to protect against common web vulnerabilities.
Your server should:
GET /api/status - Returns JSON: {"status": "ok"}GET /api/info - Returns JSON: {"app": "secure-api", "version": "1.0.0"}The application must set HTTP security headers to protect against common vulnerabilities including:
The security configuration should use sensible defaults appropriate for a production API server.
/api/status, it returns status code 200 with JSON body {"status": "ok"} @test/api/info, it returns status code 200 with JSON body containing app name and version @testX-Content-Type-Options set to nosniff @testX-Frame-Options to prevent clickjacking @test@generates
// Create and configure a Koa application with security middleware
// Export the configured app (do not call app.listen() in this module)
module.exports = app;Provides the web application framework.
Provides security header middleware for Koa applications.
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