Skip to content

Commit

Permalink
fix: support PATH_PREFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
John Conley committed Dec 11, 2018
1 parent b95bb88 commit 57b0a52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/albAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {ApiRequest, ApiResponse, ApiServer, HttpMethod, ValoryMetadata} from "va
import {ALBRequestEvent, ALBResponse, Callback, Context, FormattedRequest} from "./types/alb";
import qs = require("querystring");

const prefix = process.env.PATH_PREFIX;
const pathReplacer = /{([\S]*?)}/g;
const default404: ALBResponse = {
statusCode: 404,
Expand Down Expand Up @@ -72,7 +73,7 @@ export class ALBAdaptor implements ApiServer {
method: event.httpMethod,
isBase64Encoded: event.isBase64Encoded,
queryStringParameters: event.queryStringParameters,
url: event.path,
url: event.path.replace(prefix, ""),
};
this.router.lookup(formatted, cb);
}
Expand Down

0 comments on commit 57b0a52

Please sign in to comment.