File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,39 @@ For instance, the following will run the `textual colors` command:
5959textual run -c textual colors
6060```
6161
62+ ### Serve
63+
64+ The devtools can also serve your application in a browser.
65+ Effectively turning your terminal app in to a web application!
66+
67+ The ` serve ` sub-command is similar to ` run ` . Here's how you can serve an app launched from a Python file:
68+
69+ ```
70+ textual serve my_app.py
71+ ```
72+
73+ You can also serve a Textual app launched via a command. Here's an example:
74+
75+ ```
76+ textual serve "textual keys"
77+ ```
78+
79+ The syntax for launching an app in a module is slightly different from ` run ` .
80+ You need to specify the full command, including ` python ` .
81+ Here's how you would run the Textual demo:
82+
83+ ```
84+ textual serve "python -m textual"
85+ ```
86+
87+ Textual's builtin web-server is quite powerful.
88+ You can serve multiple instances of your application at once!
89+
90+ !!! tip
91+
92+ Textual serve is also useful when developing your app.
93+ If you make changes to your code, simply refresh the browser to update.
94+
6295## Live editing
6396
6497If you combine the ` run ` command with the ` --dev ` switch your app will run in * development mode* .
You can’t perform that action at this time.
0 commit comments