问题描述:

To read a file located in the document root of the sails project I currently use an absolute path.

/var/www/project/file.conf

How can I get the document root path in sails? Or how can I read the file in a controller by using relative path?

网友答案:

Since the main application file is app.js in the root folder, process.cwd() should work just fine for you.

网友答案:

in Sails the root path is: sails.config.appPath

相关阅读:
Top