mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #4985 from tinganho/connectModrewrite
Adds connect-modrewrite middleware
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
/// <reference path='./connect-modrewrite.d.ts' />
|
||||
/// <reference path='../express/express.d.ts' />
|
||||
|
||||
import modRewrite = require('connect-modrewrite');
|
||||
import express = require('express');
|
||||
|
||||
var app = express();
|
||||
|
||||
app.use(modRewrite([
|
||||
'^/test$ /index.html',
|
||||
'^/test/\\d*$ /index.html [L]',
|
||||
'^/test/\\d*/\\d*$ /flag.html [L]',
|
||||
]));
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for connect-modrewrite
|
||||
// Project: https://github.com/tinganho/connect-modrewrite
|
||||
// Definitions by: Tingan Ho <https://github.com/tinganho/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
declare module 'connect-modrewrite' {
|
||||
import express = require('express');
|
||||
function modrewrite(rewrites: string[]): express.RequestHandler;
|
||||
export = modrewrite;
|
||||
}
|
||||
Reference in New Issue
Block a user