Paqmind / react-ultimate

React Ultimate Example
MIT License
303 stars 64 forks source link

Fix for incorrect startup display #117

Open Grimmstar opened 5 years ago

Grimmstar commented 5 years ago

In reference to the many issues being brought up by people who were not able to get the site to start up correctly, and were brought to a folder simply listing the files, I found that this solution worked for me. By modifying "backend/server.js" and "frontend/state.js", the site now loads as intended.

In "backend/server.js"

server.on("listening", () => logger.info("Listening on port " + process.env.HTTP_PORT))
server.listen(process.env.HTTP_PORT);

should be (port number should be whatever port user is intending to use)

server.on("listening", () => logger.info("Listening on port " + process.env.HTTP_PORT || 3000))
server.listen(process.env.HTTP_PORT || 3000);

and in "frontend/state.js"

window._state = new Baobab(
  {
    url: {
      route: undefined,
      path: undefined,
      params: {},
      query: {},
    },

should instead be

window._state = new Baobab(
  {
    url: {
      route: '/public',
      path: 'http://localhost:3000/public/',
      params: {},
      query: {},
    },
ivan-kleshnin commented 5 years ago

Hello @Grimm-Child. Thank you for this PR!

The changes you propose seem reasonable to me. But I'm confused that in the comment above you're mentioning changes to backend/server.js while in the list of changed files there is an entirely new file frontend/server.js (different folders!). Something is off here.

I'm going to revive this project, so I'd like to accept your PR. Just need a clarification on the above.

ivan-kleshnin commented 5 years ago

Hey @Grimm-Child did you miss a notification bell ?