npm i @mcansh/remix-fastify
yarn add @mcansh/remix-fastify
pnpm i @mcansh/remix-fastify
npx create-remix@latest --template express
- install this
- remove
compression
,express
,morgan
,nodemon
- rename your
server.js
toserver.ts
with the following https://github.com/mcansh/remix-fastify/blob/main/example/server.ts - or change the imports to berequire
instead - add
server: "server.ts"
to remix.config.js
- note: on windows, you may need to manually call
installGlobals()
inside server.tsimport fastify from "fastify"; import * as serverBuild from "@remix-run/dev/server-build"; import { remixFastifyPlugin } from "@mcansh/remix-fastify"; import { installGlobals } from "@remix-run/node"; installGlobals(); // rest of your server code
checkout the example usage in ./example/server.ts