Find absolute base path of the project directory

后端 未结 7 1482
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 21:35

Until now we could get the absolute path of a file to open later as readStream with this code snippet:

var base = path.resolve(\'.\');
var file = base + \'/d         


        
7条回答
  •  长情又很酷
    2020-12-04 22:12

    For Meteor 0.8.3,

    __meteor_bootstrap__.serverDir gives out the working directory, when run in server mode.

    example

    if (Meteor.isServer) {
       console.log(__meteor_bootstrap__.serverDir);
    }
    

提交回复
热议问题