mcansh
released this
25 Apr 14:51
·
80 commits
to main
since this release
Minor Changes
-
597df2e: re-introduce plugin for easy configuration, we're still publicly exporting all the pieces, so you can still continue to configure your server as you do today.
import { remixFastify } from "@mcansh/remix-fastify"; import { installGlobals } from "@remix-run/node"; import { fastify } from "fastify"; installGlobals(); let app = fastify(); await app.register(remixFastify); let port = Number(process.env.PORT) || 3000; let address = await app.listen({ port, host: "0.0.0.0" }); console.log(`✅ app ready: ${address}`);
and if you need to configure loadContext, you can do so like this:
import { remixFastify } from "@mcansh/remix-fastify"; import { installGlobals } from "@remix-run/node"; import { fastify } from "fastify"; installGlobals(); let app = fastify(); await app.register(remixFastify, { getLoadContext(request, reply) { return {}; }, }); let port = Number(process.env.PORT) || 3000; let address = await app.listen({ port, host: "0.0.0.0" }); console.log(`✅ app ready: ${address}`);