简体   繁体   中英

Node.js/Express static assets connection refused

I have just deployed my Express app to a production server and I'm no longer being served my static assets.

My assets are in /public and I call the static middleware like so:

// config.root => /var/www
app.use(express.static(config.root + '/public'));

When I spin up my site, the stylesheets aren't coming through and I'm seeing:

GET http://--- redacted ---/scripts/main.js net::ERR_CONNECTION_REFUSED

If I open up the stylesheet URL I can see it no problem.

What am I missing here?

There was a bug (undefined function) in one of my middleware functions. Check your logs, people!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM