Skip to content

Commit 5455bca

Browse files
committed
fixes #33: Only listen to functionTarget.
1 parent dc5efa3 commit 5455bca

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ if (!USER_FUNCTION) {
9696
process.exit(1);
9797
}
9898

99-
const SERVER = getServer(USER_FUNCTION!, SIGNATURE_TYPE!);
99+
const SERVER = getServer(USER_FUNCTION!, SIGNATURE_TYPE!, TARGET);
100100
const ERROR_HANDLER = new ErrorHandler(SERVER);
101101
SERVER.listen(PORT, () => {
102102
ERROR_HANDLER.register();

src/invoker.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,13 +548,14 @@ export class ErrorHandler {
548548
*/
549549
export function getServer(
550550
userFunction: HandlerFunction,
551-
functionSignatureType: SignatureType
551+
functionSignatureType: SignatureType,
552+
functionTarget: string
552553
): http.Server {
553554
// App to use for function executions.
554555
const app = express();
555556

556557
// Set request-specific values in the very first middleware.
557-
app.use('/*', (req, res, next) => {
558+
app.use(`/${functionTarget}`, (req, res, next) => {
558559
latestRes = res;
559560
res.locals.functionExecutionFinished = false;
560561
next();

0 commit comments

Comments
 (0)