#How do you declare and pass the loadContext ?

1 messages · Page 1 of 1 (latest)

gleaming needle
#

When you setup a remix app you have a function "handleRequest" in the file "entry.server.tsx" and the fifth argument is "loadContext" but it is unused and from what i understand this is supposed to be used to pass global variables into the loader and action functions, is there any documentation on this subject ? The only documentation I can find use the express way. (i'm using remix serve)

hardy sun
#

You need to use getLoadContext in the http server (eg express)

gleaming needle
#

So you can't do it with remix dev ?

#

remix dev is an embeded express server no?

#

We should be able to do it in the entry.server.tsx, the argument is even present in the handleRequest function...

hardy sun
#

Yeah you can’t with the Remix App Server, you need to switch to Express or another server

hardy sun
gleaming needle
#

Ok! thanks

hardy sun
gleaming needle
#

Is it safe to use ?

#

And is it safe to use remix-serve in production ?