简体   繁体   English

Node.js 快速框架服务 static swf 文件

[英]Node.js express framework serve static swf file

I need to serve static swf using express framework generating dynamic view similar to:我需要使用 express 框架生成类似于以下内容的动态视图来为 static swf 提供服务:

    app.get('/*', function(req, res){
// serve swf here

});

Thanks谢谢

Is there some reason you can't just declare a static folder?有什么原因你不能只声明一个 static 文件夹吗?

app.use(express.static(__dirname + '/public'));

If you don't want to use the Express static folder, then you can just read the file off of the file system and serve it directly.如果你不想使用 Express static 文件夹,那么你可以从文件系统中读取文件并直接提供它。

res.sendfile('path/to/my.swf');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM