CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-http-proxy-middleware

The one-liner node.js proxy middleware for connect, express, next.js and more

92

1.24x
Quality

Pending

Does it follow best practices?

Impact

92%

1.24x

Average score across 10 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

criteria.jsonevals/scenario-4/

{
  "context": "This criteria evaluates how well the engineer uses http-proxy-middleware to solve the request body fixing problem. The focus is on correctly importing and using the createProxyMiddleware function and the fixRequestBody handler to reconstruct request bodies that have been consumed by body-parser middleware.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Import createProxyMiddleware",
      "description": "Correctly imports the createProxyMiddleware function from http-proxy-middleware package",
      "max_score": 10
    },
    {
      "name": "Import fixRequestBody",
      "description": "Correctly imports the fixRequestBody handler from http-proxy-middleware package",
      "max_score": 15
    },
    {
      "name": "Create proxy middleware",
      "description": "Uses createProxyMiddleware to create proxy middleware with appropriate configuration (target, changeOrigin, etc.)",
      "max_score": 20
    },
    {
      "name": "Register fixRequestBody handler",
      "description": "Registers the fixRequestBody handler in the on.proxyReq event to fix request bodies after body-parser consumption",
      "max_score": 30
    },
    {
      "name": "Apply to JSON route",
      "description": "Applies the proxy middleware to the /api/data route after body-parser.json() middleware",
      "max_score": 10
    },
    {
      "name": "Apply to form route",
      "description": "Applies the proxy middleware to the /api/form route after body-parser.urlencoded() middleware",
      "max_score": 10
    },
    {
      "name": "Proper middleware ordering",
      "description": "Ensures body-parser middleware is registered before the proxy middleware so request bodies are parsed first then fixed for proxying",
      "max_score": 5
    }
  ]
}

tile.json