Add description [TODO]
- Python 3.5
- Create a new main file:
$ touch app.py
where app
is the main application.
- Open the
app.py
file and import HIL core:
from HIL import Core
- Create a new component file:
$ touch bell.py
where bell
is a sub application.
- Open the
bell.py
file and write a sample component:
from HIL import Component
class Bell(Component):
def play():
print(chr(7))
return None
- Open the
app.py
and import the new component into your main application:
from bell import Bell
- Initialize the core framework:
core = Core()
- Add the new component class:
core.addComponent(Bell)
- Add the run command to your main server:
core.start()
- Run your server:
$ python3 app.py
- Open a terninal and run the following command:
$ curl -X POST --data "component=Bell&event=play" http://localhost:8000
Using a browser, go to http://localhost:8000/documentation
and you'll see the documentation of the api.
There is a sample app at https://github.com/fvioz/HIL-sample please check