Write HTTP APIs in a given language, then you can now write functions in that language, for any of our triggers. We get requests for different languages through our various feedback channels, or in some cases users just want a little more control over the environment. There’s now a protocol for you to receive dispatch events using a lightweight HTTP server you provide (a “custom handler”), which can route things to individual functions.
-
You need a functions version 2.0.12961 or higher.
-
The core of a handler is being able to write something that can receive a POST over http://127.0.0.1:port/functionName according to this request schema and response schema.
-
The FUNCTIONS_HTTPWORKER_PORT environment variable defines the port.
-
Beyond writing the handler against that schema, you’ll need to set the executable path and possibly a worker path (as in JS) in host.json.
-
Some example handlers can be found in this repo