You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the gruntfile, my script is configured as script: 'app/app.js' since effectively (correct me if I'm wrong) node is running from the position of the gruntfile. This means that I have to define static paths in my app relative to the Gruntfile like so: app.use(express.static('app/client'));
Which means if I want to run my app elsewhere, not using grunt, I need to run node from one directory up and run node app/app.js.
In Gruntfile.js it would nice to be able to do something like
options: {
cwd: 'app',
script: 'app.js',
}
So paths in the app are relative to the app.js file, like so: app.use(express.static('client'));
Maybe I'm thinking of it in the wrong way, any help would be great.
The text was updated successfully, but these errors were encountered:
I have a directory structure like this:
In the gruntfile, my script is configured as
script: 'app/app.js'
since effectively (correct me if I'm wrong) node is running from the position of the gruntfile. This means that I have to define static paths in my app relative to the Gruntfile like so:app.use(express.static('app/client'));
Which means if I want to run my app elsewhere, not using grunt, I need to run node from one directory up and run
node app/app.js
.In Gruntfile.js it would nice to be able to do something like
So paths in the app are relative to the app.js file, like so:
app.use(express.static('client'));
Maybe I'm thinking of it in the wrong way, any help would be great.
The text was updated successfully, but these errors were encountered: