Skip to content

Commit

Permalink
docs(README): express request and response generics example
Browse files Browse the repository at this point in the history
  • Loading branch information
chimurai committed May 13, 2024
1 parent 465dd8a commit 5c003fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ app.listen(3000);
// typescript

import * as express from 'express';
import { createProxyMiddleware, Filter, Options, RequestHandler } from 'http-proxy-middleware';
import { createProxyMiddleware } from 'http-proxy-middleware';
import type { Request, Response, NextFunction } from 'express';
import type { Filter, Options, RequestHandler } from 'http-proxy-middleware';

const app = express();

app.use(
'/api',
createProxyMiddleware({
createProxyMiddleware<Request, Response>({
target: 'http://www.example.org/api',
changeOrigin: true,
}),
Expand Down

0 comments on commit 5c003fb

Please sign in to comment.