Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的应用程序有一个类似于以下的结构:
我在目录中有一些静态文件public。a.js位于目录中的应用程序如何ApplicationA访问public目录。
public
a.js
ApplicationA
var path = require("path") var target = "../public/" var resolved = path.relative(__dirname, target)
你的意思是你想上一个目录?如果是这样../,请使用您所在的目录,例如,如果ApplicationA并且public在同一目录中,您可以使用:
../
../public/filename.file