You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This will be called each time application is `enabled` or `disabled`
32
+
#NOTE: `user` is unavailable on this step, so all NC API calls that require it will fail as unauthorized.
33
+
print(f"enabled={enabled}")
34
+
if enabled:
35
+
nc.log(LogLvl.WARNING, f"Hello from {nc.app_cfg.app_name} :)")
36
+
else:
37
+
nc.log(LogLvl.WARNING, f"Bye bye from {nc.app_cfg.app_name} :(")
38
+
# In case of an error, a non-empty short string should be returned, which will be shown to the NC administrator.
39
+
return""
40
+
41
+
42
+
if__name__=="__main__":
43
+
# Wrapper around `uvicorn.run`.
44
+
# You are free to call it directly, with just using the `APP_HOST` and `APP_PORT` variables from the environment.
45
+
run_app("main:APP", log_level="trace")
12
46
13
47
What's going on in the skeleton?
14
48
@@ -49,6 +83,8 @@ With help of ``AppAPIAuthMiddleware`` you can add **global** AppAPI authenticati
49
83
50
84
.. note:: ``AppAPIAuthMiddleware`` supports **disable_for** optional argument, where you can list all routes for which authentication should be skipped.
51
85
86
+
Repository with the skeleton sources can be found here: `app-skeleton-python <https://github.com/cloud-py-api/app-skeleton-python>`_
0 commit comments