Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pathRewrite): expose the
req
object (#76)
* feat(pathRewrite): expose the `req` object * chore(tests): split proxyTable in unit & e2e tests
- Loading branch information
Showing
16 changed files
with
761 additions
and
644 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var express = require('express'); | ||
var proxyMiddleware = require('../../index'); | ||
|
||
module.exports = { | ||
createServer: createServer, | ||
proxyMiddleware: proxyMiddleware | ||
}; | ||
|
||
function createServer(portNumber, middleware, path) { | ||
var app = express(); | ||
|
||
if (middleware, path) { | ||
app.use(path, middleware); | ||
} else if (middleware) { | ||
app.use(middleware); | ||
} | ||
|
||
var server = app.listen(portNumber); | ||
|
||
return server; | ||
} |
Oops, something went wrong.