mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
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:
@@ -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
|
||||
|
||||
Vendored
+3
-25
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user