Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't find reload.js #95

Closed
39Er opened this issue May 27, 2017 · 4 comments
Closed

can't find reload.js #95

39Er opened this issue May 27, 2017 · 4 comments

Comments

@39Er
Copy link

39Er commented May 27, 2017

server

const reload = require('reload');
  const http = require('http');

  const server = http.createServer(app);
  require('./client/router/routes')(app);
  reload(server, app);
  server.listen(port, () => {
    logger.info('App (dev) is now running on %s', port);
  });

index.html
<script src="/reload/reload.js"></script>

routes.js

module.exports = function (app) {
  app.get('/*', (req, res) => {
    res.render('index');
  });
};

Those are my codes.But it can't find reload.js.
I think it because I use '/*' to render html.Dose reload use '/reload' route? My app is a SPA,so I must use '/*',how can I solve that? By the way,I think using '/reload' route to reload is not a good idea,because it's invasive.Can you give me some advice?

@ghost
Copy link

ghost commented May 27, 2017

Could you post the exact error please.

@alallier
Copy link
Owner

Yes reload creates a /reload route.

@39Er
Copy link
Author

39Er commented May 31, 2017

@alallier So how can I desgin the '/reload ' route to reload my page ?

@alallier
Copy link
Owner

@39Er just make sure you load reload before your /* route. That way your application can still hit the reload route. Express route order matters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants