Documentation
code/hello-world/ $ tomodachi run service/app.py

Running a service

CLI alias is set up automatically on installation

# generic execution of services
app/ $ tomodachi run <path to .py file with service class code>

# example: if our service class exists in service/app.py
app/ $ tomodachi run service/app.py

Defaults to output information on stdout.

app/ $ tomodachi run service/app.py
>
> ---
> Starting tomodachi services (pid: 1) ...
> * service.py
>
> Current version: tomodachi x.x.xx on Python 3.x.x
> Event loop implementation: asyncio
> Local time: October 04, 2020 - 13:38:01,201509 UTC
> Timestamp in UTC: 2020-10-04T13:38:01.201509Z
>
> File watcher is active - code changes will automatically restart services
> Quit running services with <ctrl+c>
>
> 2020-10-04 13:38:01,234 (service): Initializing service "example" [id: <uuid>]
> 2020-10-04 13:38:01,248 (http): Listening [http] on http://127.0.0.1:9700/
> 2020-10-04 13:38:01,248 (service): Started service "example" [id: <uuid>]

HTTP services acts like a normal web server.

~/ $ curl -v "http://127.0.0.1:9700/resource/1234"
> HTTP/1.1 200 OK
> Content-Type: text/plain; charset=utf-8
> Server: tomodachi
> Content-Length: 9
> Date: Mon, 02 Oct 2017 13:38:02 GMT
>
> id = 1234