Browse Source

code review

Falko Schindler 2 years ago
parent
commit
b93b883e4e

+ 9 - 15
examples/fastapi/start.sh

@@ -1,23 +1,17 @@
 #!/usr/bin/env bash
 
-if [ "$#" -ne 1 ]; then
-  echo "Usage: $0 <prod|dev>"
-  exit 1
-fi
-
 # use path of this demo as working directory; enables starting this script from anywhere
-cd "$(dirname "$0")" 
+cd "$(dirname "$0")"
 
 if [ "$1" = "prod" ]; then
-  echo "Starting Uvicorn server in production mode..."
-  # we also use a single worker in production mode so socket.io connections are always handled by the same worker
-  uvicorn main:app --workers 1 --log-level info --port 80
+    echo "Starting Uvicorn server in production mode..."
+    # we also use a single worker in production mode so socket.io connections are always handled by the same worker
+    uvicorn main:app --workers 1 --log-level info --port 80
 elif [ "$1" = "dev" ]; then
-  echo "Starting Uvicorn server in development mode..."
-  # reload implies workers = 1
-  uvicorn main:app --reload --log-level debug --port 8000
+    echo "Starting Uvicorn server in development mode..."
+    # reload implies workers = 1
+    uvicorn main:app --reload --log-level debug --port 8000
 else
-  echo "Invalid parameter. Use 'prod' or 'dev'."
-  exit 1
+    echo "Invalid parameter. Use 'prod' or 'dev'."
+    exit 1
 fi
-

+ 2 - 2
examples/nginx_subpath/README.md

@@ -13,6 +13,6 @@ docker-compose up
 ```
 
 Then you can access http://localhost/nicegui/.
-Note the trailing / in the url.
+Note the trailing "/" in the URL.
 It is important.
-We welcome suggestion on how to make it optional.
+We welcome suggestions on how to make it optional.

+ 5 - 4
examples/nginx_subpath/app/main.py

@@ -3,15 +3,16 @@ from nicegui import ui
 
 @ui.page('/subpage')
 def subpage():
-    ui.label('This is a subpage')
+    ui.label('This is a subpage.')
 
 
 @ui.page('/')
 def index():
     with ui.card().classes('mx-auto px-24 pt-12 pb-24 items-center'):
-        ui.label('this demonstrates hosting of a NiceGUI app on a subpath').classes('text-h5')
-        ui.label('as you can see the entire app is available below /nicegui but the code here does not need to know that').classes('text-lg')
-        ui.link('navigate to a subpage', subpage).classes('text-lg')
+        ui.label('This demonstrates hosting of a NiceGUI app on a subpath.').classes('text-h5')
+        ui.label('As you can see the entire app is available below "/nicegui".').classes('text-lg')
+        ui.label('But the code here does not need to know that.').classes('text-lg')
+        ui.link('Navigate to a subpage.', subpage).classes('text-lg')
 
 
 ui.run()

+ 1 - 1
test_startup.sh

@@ -33,7 +33,7 @@ check main.py || error=1
 for path in examples/*
 do
     if test -f $path/start.sh; then
-       check $path/start.sh dev || error=1 
+        check $path/start.sh dev || error=1 
     elif test -f $path/main.py; then
         check $path/main.py || error=1
     fi