A simple CORS proxy
To test the function perform the following steps:
- Start your FN server locally with
- Deploy the function by running
./gradlew fnDeployin the root folder
- To test the function run
./gradlew fnInvoke --params="url=http://echo.jsontest.com/hello/world"
The proxy will perform the request and return the result with the Access-Control-Allow-Origin header set to
so you can use the response in any of your web applications.
Please note this is example is only meant to demonstrate the capabilities of the Gradle plugin and should not be used in production.