Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PoC] Proxy Mode #223

Draft
wants to merge 7 commits into
base: v2
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adapt to new middleware repository structure
RandomByte committed Apr 14, 2020
commit dcccfc454ba437973d2fbea1ed6145d0ff77f16f
4 changes: 2 additions & 2 deletions lib/middleware/MiddlewareManager.js
Original file line number Diff line number Diff line change
@@ -137,7 +137,7 @@ class MiddlewareManager {

if (useProxy) {
await this.addMiddleware("proxyRewrite", {
wrapperCallback: (proxyRewriteModule) => {
wrapperCallback: ({middleware: proxyRewriteModule}) => {
return ({resources}) => {
return proxyRewriteModule({
resources,
@@ -183,7 +183,7 @@ class MiddlewareManager {

if (useProxy) {
await this.addMiddleware("proxy", {
wrapperCallback: (proxyModule) => {
wrapperCallback: ({middleware: proxyModule}) => {
return ({resources}) => {
return proxyModule({
resources,
4 changes: 2 additions & 2 deletions lib/middleware/middlewareRepository.js
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@ const middlewareInfos = {
serveThemes: {path: "./serveThemes"},
testRunner: {path: "./testRunner"},
nonReadRequests: {path: "./nonReadRequests"},
proxy: "./proxy",
proxyRewrite: "./proxyRewrite"
proxy: {path: "./proxy"},
proxyRewrite: {path: "./proxyRewrite"}
};

function getMiddleware(middlewareName) {