azure-function-express
Allows Express usage with Azure Function
Description
Connect your Express application to an Azure Function handler, and make seamless usage of all middlewares you are already familiar with.
Usage
In your index.js
:
const createHandler = createHandler;const express = ; // Create express app as usualconst app = ;app; // Binds the express app to an Azure Function handlermoduleexports = ;
Make sure you are binding req
and res
in your function.json
:
To allow Express handles all HTTP routes itself you may set a glob star route in a single root function.json
:
Note that segments
is not used and could be anything. See Azure Function documentation.
All examples here.
Context
All native Azure Functions context properties, except done
, are exposed through req.context
.
As en example, you can log using:
app;
Runtime compatibility
Supported Node version are:
- Node 6.11.2 (first node version supported by Azure Functions)
- Node 8 (LTS)
- Node 10
Azure Functions runtime v1 and v2 beta are both supported.
License
Apache 2.0 © Yves Merlicco