Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Node.js express framework serve static swf file

Node.js express framework serve static swf file

Problem

I need to Serve Static Swf using express framework generating dynamic view similar to:

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

});

Thanks

Problem courtesy of: Radoslav

Solution

Is there some reason you can't just declare a static folder?

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.

res.sendfile('path/to/my.swf');
Solution courtesy of: Timothy Strimple

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Node.js express framework serve static swf file

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×