diff --git a/app/v3/httpTriggerRouteParams/function.json b/app/v3/httpTriggerRouteParams/function.json index aeb4922..7813970 100644 --- a/app/v3/httpTriggerRouteParams/function.json +++ b/app/v3/httpTriggerRouteParams/function.json @@ -6,7 +6,7 @@ "direction": "in", "name": "req", "methods": ["get", "post"], - "route": "httpTriggerRouteParams/{name}" + "route": "httpTriggerRouteParams/{name}/{id}" }, { "type": "http", diff --git a/app/v4/src/functions/httpTriggerRouteParams.ts b/app/v4/src/functions/httpTriggerRouteParams.ts index 23c7607..262ffde 100644 --- a/app/v4/src/functions/httpTriggerRouteParams.ts +++ b/app/v4/src/functions/httpTriggerRouteParams.ts @@ -12,7 +12,7 @@ export async function httpTriggerRouteParams( app.http('httpTriggerRouteParams', { methods: ['GET', 'POST'], - route: 'httpTriggerRouteParams/{name}', + route: 'httpTriggerRouteParams/{name}/{id}', authLevel: 'anonymous', handler: httpTriggerRouteParams, }); diff --git a/src/http.test.ts b/src/http.test.ts index 01c4857..9cf7f84 100644 --- a/src/http.test.ts +++ b/src/http.test.ts @@ -59,11 +59,12 @@ describe('http', () => { expect(response.status).to.equal(404); }); + // Related: https://github.com/Azure/azure-functions-nodejs-library/issues/285 it('route parameters', async () => { const funcUrl = getFuncUrl('httpTriggerRouteParams'); - const response = await fetch(`${funcUrl}/testName`); + const response = await fetch(`${funcUrl}/testName/5`); const body = await response.json(); - expect(body).to.deep.equal({ name: 'testName' }); + expect(body).to.deep.equal({ name: 'testName', id: '5' }); expect(response.status).to.equal(200); });