Merge pull request #4675 from rehmsen/feature/express_exposing_static

Import type definitions for express.static from serve-static instead …
This commit is contained in:
Masahiro Wakame
2015-06-23 01:55:07 +09:00
2 changed files with 6 additions and 25 deletions
+3
View File
@@ -6,6 +6,9 @@ var app = express();
app.engine('jade', require('jade').__express);
app.engine('html', require('ejs').renderFile);
express.static.mime.define({
'application/fx': ['fx']
});
app.use('/static', express.static(__dirname + '/public'));
// simple logger
+3 -25
View File
@@ -11,6 +11,7 @@
=============================================== */
/// <reference path="../node/node.d.ts" />
/// <reference path="../serve-static/serve-static.d.ts" />
declare module Express {
@@ -24,6 +25,7 @@ declare module Express {
declare module "express" {
import http = require('http');
import serveStatic = require('serve-static');
function e(): e.Express;
@@ -1067,31 +1069,7 @@ declare module "express" {
response: Response;
}
/**
* Static:
*
* Static file server with the given `root` path.
*
* Examples:
*
* var oneDay = 86400000;
*
* connect()
* .use(connect.static(__dirname + '/public'))
*
* connect()
* .use(connect.static(__dirname + '/public', { maxAge: oneDay }))
*
* Options:
*
* - `maxAge` Browser cache maxAge in milliseconds. defaults to 0
* - `hidden` Allow transfer of hidden files. defaults to false
* - `redirect` Redirect to trailing "/" when the pathname is a dir. defaults to true
*
* @param root
* @param options
*/
function static(root: string, options?: any): RequestHandler;
var static: typeof serveStatic;
}
export = e;