Files
DefinitelyTyped/serve-static/serve-static-tests.ts
Daniel Whitney 25fde56c8d Added fallthrough option as added in v 1.10.0 (#9121)
* Update to include fallthrough option 

Fallthough added in 1.10.0: https://github.com/expressjs/serve-static/releases/tag/v1.10.0

* Update serve-static-tests.ts
2016-05-01 22:15:43 +09:00

29 lines
753 B
TypeScript

/// <reference path="serve-static.d.ts" />
/// <reference path="../express/express.d.ts" />
import * as express from 'express';
import * as serveStatic from 'serve-static';
var app = express();
app.use(serveStatic('/1'));
app.use(serveStatic('/2', { }));
app.use(serveStatic('/3', {
dotfiles: 'ignore',
etag: true,
extensions: ['html'],
fallthrough: true,
index: true,
lastModified: true,
maxAge: 0,
redirect: true,
setHeaders: function(res: express.Response, path: string, stat: any) {
res.setHeader('Server', 'server-static middleware');
}
}));
serveStatic.mime.define({
'application/babylon': ['babylon'],
'application/babylonmeshdata': ['babylonmeshdata'],
'application/fx': ['fx']
});