XervoIO / demeteorizer

Converts a Meteor app into a standard Node.js application.
http://npm.im/demeteorizer
MIT License
703 stars 59 forks source link

settings.json undefined #262

Closed aabanaag closed 7 years ago

aabanaag commented 7 years ago

Tried demeteorizer via this command

demeteorizer --output ../build --json "$(cat settings.local.json)"

but when I started the app upon doing a single http request it errors out so when I tried to check if Meteor.settings.public.keycloak (keycloakUrl) is working or returning the proper url instead it is undefined. Plus I read something about it (below) but the package.json on my end is different.

The resulting package.json will have a settings property that includes the JSON from settings.json.

Instead all of the contents of settings.local.json was just injected to package.json without the settings property. Any ideas?

fiveisprime commented 7 years ago

Try it like this:

$ demeteorizer --output ../build --json "{ \"settings\": $(cat settings.local.json) }"

Please confirm that solves your issue so I can update the README.

aabanaag commented 7 years ago

It did worked, but I still encounter the same issue with regards to accessing Meteor.settings.public.keycloak. Any clues regarding this?

fiveisprime commented 7 years ago

I'm not sure about how settings in the package.json works. It's possible that this isn't a think anymore now that Meteor is using package.json for npm deps now (I searched around and couldn't find anything about this).

Just to get things working, create a METEOR_SETTINGS environment variable with your settings. This seems to be the most common case for accessing the settings outside of consuming the file directly.

You can use a similar command to make this work

$ export METEOR_SETTINGS="$(cat settings.local.json)"