CORS-enabled server not denying requests

CORS configuration on its own isn’t going to cause a server to deny requests. You can’t cause server-side blocking of requests just through CORS configuration. The only thing servers do differently when you configure CORS support is just to send the Access-Control-Allow-Origin response header and other CORS response headers. That’s it. Actual enforcement of cross-origin … Read more

Express.js – any way to display a file/dir listing?

As of Express 4.x, the directory middleware is no longer bundled with express. You’ll want to download the npm module serve-index. Then, for example, to display the file/dir listings in a directory at the root of the app called videos would look like: var serveIndex = require(‘serve-index’); app.use(express.static(__dirname + “https://stackoverflow.com/”)) app.use(‘/videos’, serveIndex(__dirname + ‘/videos’));