andreypopp / react-quickstart

[DEPRECATED] React project template with server-side UI rendering and routing
371 stars 47 forks source link

Use relative URL in superagent call, so pages work from other machines. #18

Closed winkler1 closed 10 years ago

andreypopp commented 10 years ago

Hm... does it work from the server?

winkler1 commented 10 years ago

Tested by fresh page load of http://localhost:3000/users/ivan to force server-side rendering... nope, did not work. Client.js#renderApp could have the App know its base URL via req.protocol + '://' + req.get('host'). Passing it to UserPage seems like a pain...server base url feels like a global components should be able to easily acquire.

andreypopp commented 10 years ago

Feel free to reopen if you found a better solution to not using absolute URLs.