{"repo":"fastify/fastify-express","free":true,"listed":false,"github":"https://github.com/fastify/fastify-express","clone":"git clone https://github.com/fastify/fastify-express.git","description":"Express compatibility layer for Fastify","language":"JavaScript","stars":273,"topics":["fastify","express","compatibility","fastify-plugin"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"@fastify/express This plugin adds full Express compatibility to Fastify, it exposes the same use function of Express, and it allows you to use any Express middleware or application. Note This plugin should not be used as a long-term solution, it aims to help you have a smooth transition from Express to Fastify, but you should migrate your Express specific code to Fastify over time. Since Express does not support Node.js core HTTP/2 module , this plugin does not support HTTP/2 either. Install Compatibility Plugin version Fastify version --------------- ----------------- =4.x ^5.x =2.x Note: In prefixed plugins, @fastify/express rewrites string, array, and RegExp mount paths to include the prefix. RegExp paths with ^ anchors inside groups (e.g., /(?:^\\/a ^\\/b)/ ) are not rewritten correctly. Use array paths instead: fastify.use(['/a', '/b'], middleware) . Wrap Express req in Proxy It is possible to wrap the Express request object in a Proxy by passing createProxyHandler function to generate the Proxy handler. The function will receive the Fastify request object as the first parameter. For example, using Proxy to expose something from Fastify request into the Express request. TypeScript support To use this module with TypeScript, make sure to install @types/express . You will need to add \"types\": [\"@fastify/express\"] to your tsconfig.json file when using require to import the plugin. Middleware alternatives Fastify offers some alternatives to the most commonly used middleware: E","default_branch":null,"files":null,"tree":[],"storefront":"/r/fastify","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/fastify/fastify-express/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}