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-2/

{
  "context": "This evaluation assesses how effectively the engineer uses http-proxy-middleware to create a basic API gateway that forwards requests to different backend services. The focus is on proper usage of the package's core proxy configuration, path filtering, and error handling capabilities.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "createProxyMiddleware Usage",
      "description": "Uses the createProxyMiddleware function from http-proxy-middleware to create proxy middleware instances for routing requests to backend services.",
      "max_score": 25
    },
    {
      "name": "Target Configuration",
      "description": "Correctly configures the 'target' option in createProxyMiddleware to specify the destination backend URLs (http://localhost:4001 for users, http://localhost:4002 for products).",
      "max_score": 20
    },
    {
      "name": "Path Filtering",
      "description": "Properly implements path-based routing using either the pathFilter option or by mounting the proxy middleware on specific Express routes (e.g., /api/users, /api/products) to forward requests to the appropriate backend service.",
      "max_score": 20
    },
    {
      "name": "changeOrigin Option",
      "description": "Sets the 'changeOrigin' option to true in the proxy configuration to change the origin of the host header to match the target URL, ensuring compatibility with virtual hosted sites.",
      "max_score": 20
    },
    {
      "name": "Error Event Handler",
      "description": "Implements error handling using the 'on.error' event handler in the proxy configuration to handle connection failures and return appropriate 5xx error responses when backend services are unavailable.",
      "max_score": 15
    }
  ]
}

tile.json