作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我想链接到 /node_modules/jade/runtime.min.js
客户端——如何让它公开访问?
我是否以某种方式为它创建一个 app.get
?
app.get('/js/jade-runtime.js',<what goes here?>)
或者我可以修改静态的东西以允许它被提供吗?
app.use(express.static(path.join(__dirname, 'public'))); // modify this to add more paths somehow
app.get('/js/jade-runtime.js',function(req,res) {
res.sendfile(path.join(__dirname,'node_modules','jade','runtime.min.js'));
});
最佳答案
您可以将它与您的 app.get
一起使用。
res.sendfile('jade-runtime.js');
显然,使用该文件所在位置的正确路径。
关于node.js - 如何链接到 node_modules 中的 JavaScript 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14097408/
我正在开发一个 voip 调用应用程序。我需要做的是在接到来电时将 Activity 带到前台。我在应用程序中使用 Twilio,并在收到推送消息时开始调用。 问题是我试图在接到任何电话时显示 Act
我是一名优秀的程序员,十分优秀!