#Setting getLoadContext on Remix App Server

1 messages · Page 1 of 1 (latest)

copper iron
#

Setting getLoadContext on Remix App Server

#

I'm currently using vercel for production deploys and the remix app server for local development and using getLoadContext for dependencies injection.

For Vercel i can just set the getLoadContext function in server.js but I'm not sure how to set it for the app server in local dev.

(Created this in the wrong category (should be in help) but discord doesn't let me delete my own thread.)

radiant magnet
#

With the remix dev command, you can't set the getLoadContext function. You need to expose express directly. Take a look at the dev command (https://github.com/remix-run/remix/blob/main/packages/remix-dev/cli/commands.ts#L261) being used for the remix cli and basically copy that to a file to your own app. Then change your dev script to something like concurrently "remix watch" "node ./dev.js"

GitHub

Build Better Websites. Create modern, resilient user experiences with web fundamentals. - remix/commands.ts at main · remix-run/remix