Skip to content

Commit 3343247

Browse files
authored
Merge pull request #497 from constructive-io/anmol/fix-express-call
bugfix: add express 5 compatible path
2 parents 3093161 + 496cddc commit 3343247

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

functions/send-email-link/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export const sendEmailLink = async (
291291
};
292292

293293
// HTTP/Knative entrypoint (used by @constructive-io/knative-job-fn wrapper)
294-
app.post('*', async (req: any, res: any, next: any) => {
294+
app.post('/', async (req: any, res: any, next: any) => {
295295
try {
296296
const params = (req.body || {}) as SendEmailParams;
297297

functions/simple-email/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const getRequiredField = (
2727

2828
const isDryRun = parseEnvBoolean(process.env.SIMPLE_EMAIL_DRY_RUN) ?? false;
2929

30-
app.post('*', async (req: any, res: any, next: any) => {
30+
app.post('/', async (req: any, res: any, next: any) => {
3131
try {
3232
const payload = (req.body || {}) as SimpleEmailPayload;
3333

jobs/knative-job-example/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import app from '@constructive-io/knative-job-fn';
22

3-
app.post('*', async (req: any, res: any, next: any) => {
3+
app.post('/', async (req: any, res: any, next: any) => {
44
if (req.body.throw) {
55
next(new Error('THROWN_ERROR'));
66
} else {

jobs/knative-job-server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default (pgPool: Pool = poolManager.getPool()) => {
103103
res.status(200).json({ workerId, jobId: jobIdHeader });
104104
});
105105

106-
app.post('*', async (req: JobRequest, res: JobResponse, next: NextFn) => {
106+
app.post('/callback', async (req: JobRequest, res: JobResponse, next: NextFn) => {
107107
const jobId = req.get('X-Job-Id');
108108

109109
if (typeof jobId === 'undefined') {

0 commit comments

Comments
 (0)