Define basic library structure

This commit is contained in:
havlong
2022-12-15 18:31:39 +03:00
parent 231751bb58
commit e184c49a1f
9 changed files with 99 additions and 8 deletions

View File

@@ -8,18 +8,26 @@ You will probably need to install ***uvicorn*** to launch a server built with Fa
python3 -m pip install "uvicorn[standard]"
```
After importing an app such as
main.py:
After importing an app such as `main.py`:
```python
from vue_apps_py.vue_app_server import VueApp
from src.vue_apps_py.security import SecurityHelper
from src.vue_apps_py.server import VueApp
from src.vue_apps_py.client import ClientAPI
from src.vue_apps_py.server_utils.models import Intent
app = VueApp()
# Initialize API
api = ClientAPI(client_id='vue-app-0', client_secret='abccf12389efab222')
# Prepare Security
key_holder = SecurityHelper(public_key='abbcbbbcaksjdhf/skdjhfnnsn/sjdkfjj21234=')
# Get Vue Application Server
vue_app = VueApp(client_api=api, security_helper=key_holder, intents=[Intent.INLINE_QUERY], debug=True)
```
You can launch web server:
```shell
uvicorn main:app --reload
uvicorn test:vue_app --reload
```