Try it

Hello world

https://base3.dev/examples/hello_world/hello_world.py
import base

@base.route("/")
class IndexHandler(base.Base):

    @base.api()
    async def get(self):
        return {"message": "Hello World"}

if __name__ == "__main__":
    base.run()

Using local python3 installation and venv

mkdir base-demo && cd base-demo

python3 -m venv .venv

source .venv/bin/activate

pip install wheel base3

curl https://base3.dev/examples/hello_world/hello_world.py -o hello_world.py

python hello_world.py

Open browser and visit http://localhost:9000

Using docker / docker-compose

mkdir base-demo && cd base-demo

curl https://base3.dev/examples/hello_world/hello_world.py -o hello_world.py

curl https://base3.dev/examples/hello_world/docker-compose.yaml -o docker-compose.yaml

curl https://base3.dev/examples/hello_world/Dockerfile -o Dockerfile

docker-compose up

Open browser and visit http://localhost:9000

Microservice based example (using docker / docker-compose)

git clone https://github.com/digital-cube/base3example-contacts.git

cd base3example-contacts

git submodule update --init --recursive

cd users/keys

# generate key without password

ssh-keygen -t rsa -b 1024 -m PEM -f jwt.private_key

openssl rsa -in jwt.private_key -pubout -outform PEM -out jwt.public_key && rm jwt.private_key.pub

cd ../..

docker-compose up

Open browser or postman and visit

GET http://localhost:10000/api/users/about

GET http://localhost:10001/api/contacts/about

GET/POST http://localhost:10000/api/users/

GET/POST http://localhost:10000/api/users/sessions