It seems like you are utilizing express in a similar manner as shown below:
app.js
// configuration
app.configure(function() {
//..
app.use(express.static(__dirname + '/public'));
//..
}
Explanation
express.static
is responsible for serving the static assets, where the argument points to the root directory from which these assets will be served.
The reference does not pertain to the web page path; rather, it relates to the directory within the Node.js project. By using __dirname, the folder becomes relative to app.js.
In essence:
If __dirname + '/public'
equates to http://www.example.com/
,
then /public/images
translates to http://www.example.com/images
As a result, the CSS code should be:
.home-bg {
background-image:url('/images/bg.jpg');
}