Fastify server request handler for Remix
MIT License
Bot releases are visible (Hide)
a7fcb6d: allows you to customize the cache control for both the files in the build directory as well as your public directory if you need to. using pretty-cache-header
under the hood so things like 1y
or 30 days
will work
await app.register(remixFastify, {
assetCacheControl: {},
defaultCacheControl: {},
});
a7fcb6d: fix cache control so that build assets are immutable and cached for 1 year instead of everything being cached for 1 hour
Published by mcansh 6 months ago
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}`);
90c6c61: changeset for #324
bump dependencies to the latest versions
Published by github-actions[bot] 9 months ago
9300c22: feat: allow http2/https servers
previously using fastify({ http2: true })
or fastify({ https: {...} })
resulted in type errors for the handler when passing the request
this has been fixed by passing the server type to all uses of the request and reply internally
this PR allows any server that extends http.Server | https.Server | http2.Http2Server | http2.Http2SecureServer;
Published by github-actions[bot] 10 months ago
criticalCss
option from createRequestHandler as it's now handled by the vite plugin in an agnostic wayPublished by github-actions[bot] 11 months ago
criticalCss
option from createRequestHandler as it's now handled by the vite plugin in an agnostic wayPublished by github-actions[bot] 11 months ago
Published by github-actions[bot] 11 months ago
example usage: https://github.com/mcansh/remix-fastify/blob/main/examples/unstable-vite/server.js#L66-L95
Published by github-actions[bot] 11 months ago
staticFilePlugin
wrapper around @fastify/static
as the example is now configured properly to find new files without colliding with remix routesPublished by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
filePublicPath
.Published by mcansh about 1 year ago
40e8daa: remove plugin in favor of having server code in server. this allows live reload funcationally of remix dev
to work
you can find an example of the updated server code in /example/server.js
Published by github-actions[bot] about 1 year ago
4789835: add custom contentParser for json
fastify automatically configures application/json
which prevents fethcer.submit from working with json encoding
Published by github-actions[bot] over 1 year ago
31c3507: feat: require explicit installGlobals
call in server entry
newer versions of node include Request
, Response
, Headers
, fetch
, etc globals
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by mcansh over 1 year ago
Published by mcansh over 1 year ago
Full Changelog: https://github.com/mcansh/remix-fastify/compare/@mcansh/[email protected]...@mcansh/[email protected]