You should now have a brick instance up and running. It's time to see what it has to offer.
The IC project aims to get infrastructure development as close as possible to traditional software development. We are used to seeing regular functions that expose their API by returning a more or less complex value. It's the same with bricks. To make something available for interaction, just return it!
Let's update our brick by exposing the route of our HTTP API:
from iclab import simple from . import assets def brick(): api = simple.api("api", "demo", "1.0.0") func = simple.function("func", "nodejs8.10", assets["handler.js"]) func.http(api, "get", "/hello") return func["routes"] # <======
You can proceed as usual to update your already deployed instance:
ic aws up simple_demo
As there are no changes in the actual resources, the update plan is pretty simple. Accept and proceed:
Plan review ⬆ plan UPDATE Do you want to continue? [y/N]: y
Once the deployment finished, we can query the instance to access its public value:
ic aws value simple_demo
Copy and paste the URL into your browser... Congratulations! You have successfully deployed your very first brick.
You can literally return any value. Feel free to experiment, for example, by updating your brick to return an array of routes.