Updating
This commit is contained in:
15
api/src/functions/httpTrigger1.ts
Normal file
15
api/src/functions/httpTrigger1.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { app, HttpRequest, HttpResponseInit, InvocationContext } from "@azure/functions";
|
||||
|
||||
export async function httpTrigger1(request: HttpRequest, context: InvocationContext): Promise<HttpResponseInit> {
|
||||
context.log(`Http function processed request for url "${request.url}"`);
|
||||
|
||||
const name = request.query.get('name') || await request.text() || 'world';
|
||||
|
||||
return { body: `Hello, ${name}!` };
|
||||
};
|
||||
|
||||
app.http('httpTrigger1', {
|
||||
methods: ['GET', 'POST'],
|
||||
authLevel: 'anonymous',
|
||||
handler: httpTrigger1
|
||||
});
|
||||
Reference in New Issue
Block a user