bdefore / universal-redux

An npm package that lets you jump right into coding React and Redux with universal (isomorphic) rendering. Only manage Express setups or Webpack configurations if you want to.
MIT License
460 stars 48 forks source link

Double serialization in config? #67

Closed jazzido closed 8 years ago

jazzido commented 8 years ago

My universal-redux-config.js declares this global:

globals: {
  //...
  __API_ENDPOINT__: process.env.API_ENDPOINT || 'http://localhost:9292'
  // ...
}

My server sees __API_ENDPOINT__ as "http://localhost:9292/" (quotes included). Looks like there's a double serialization somewhere in the config code.

bdefore commented 8 years ago

@jazzido a while back, i made a change to stringify all incoming globals here https://github.com/bdefore/universal-redux/blob/master/bin/merge-configs.js#L83. i believe the issue was that if they weren't at all, the server would fail to start when given certain values. for now, you can get around it by using JSON.parse on the other end what should already be strings. Not ideal I agree.

jazzido commented 8 years ago

Submitted PR #72, there was a double serialization in configure.js.