Run redwoodjs on premise

Hi.

How can I run redwoodjs on premise? There are ways to deploy in the cloud but I would like to test it internally before deploying it. I did a yarn rw build and added the folder web/dist to nginx. The home-page is fine, but when I try to get the list of units I get two errors.

Error: "Network error: JSON.parse: unexpected character at line 1 column 1 of the JSON data"

Error: "Minified React error #152; visit https://reactjs.org/docs/error-decoder.html?invariant=152&args[]=c for the full message or use the non-minified dev environment for full errors and additional helpful warnings."

nginx.conf on macos:

location / {
    root   /Users/claus/devel/redwoodjs/utstyr/web/dist;
    index  index.html index.htm;
}

This is ver. 0.8.2. Shall I upgrade to 0.10.0?

Regards
Claus

1 Like

Nice! I think that should’ve worked, maybe upgrading would be a good idea since we fixed a bunch of things in the way the Routes are generated.

If that doesn’t work please let me know - I would love to have “on premise” working

1 Like

I upgraded to 0.10.0 and yarn rw build but get the same error. Looking in /usr/local/var/log/nginx/error.log I see the entry

/Users/claus/devel/redwoodjs/utstyr/web/dist/.netlify/functions/graphql" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "POST /.netlify/functions/graphql HTTP/1.1", host: "localhost:8080", referrer: "http://localhost:8080/steder

It is looking for a folder called .netlify which I can’t locate either in web/dist nor in any other folder.

Ah, yes, that setting is coming from redwood.toml. The apiProxyPath is effectively what the API endpoint will be in production. So likely you’ll need to update that for running production environment locally.