- For ubuntu
sudo apt install python-uvicorn
- For fedora
sudo dnf install python-uvicorn
- For MacOS
sudo brew install uvicorn
- Using pip
pip install uvicorn
uvicorn node:app
INFO: Started server process [163692]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
And then send a request
curl http://127.0.0.1:8000/last_block
Result:
{
"block_id": 0,
"prev_hash": "0",
"data": [],
"timestamp": 1689275524
}