当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - How to get document root in sailsjs?

问题描述:

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: