Skip to content

Commit 2e031e3

Browse files
committed
Draft
1 parent 311fc1c commit 2e031e3

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

docs/operate/control/single-page-apps.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@ type: docs
77
description: "Create and deploy single page applications on the Viam platform."
88
---
99

10+
- Deploy front-end apps
11+
-
12+
13+
you can have multiple HTML files
14+
files have to all be deployed
15+
1016
With single page apps you can create and deploy custom web interfaces for your machines that use a single HTML page.
11-
Single page apps are accessible from a dedicated URL (`appname.publicnamespace.viamapps.com`) and hosting and authentication is handled for you.
17+
Single page apps are accessible from a dedicated URL (`appname_publicnamespace.viamapplications.com`) and hosting and authentication is handled for you.
18+
19+
google SPA and include what exactly that means
1220

1321
When opening an app, users log in and then select a machine they have access to.
1422
Then your app is rendered and ready for use.
@@ -56,7 +64,7 @@ TODO: how do you connect to the machine / how do you access the api key?
5664
"applications": [
5765
{
5866
"name": "your-app-name",
59-
"type": "web",
67+
"type": "single_machine",
6068
"entrypoint": "dist/index.html"
6169
}
6270
]
@@ -75,7 +83,7 @@ TODO: how do you connect to the machine / how do you access the api key?
7583
"applications": [
7684
{
7785
"name": "dashboard",
78-
"type": "web",
86+
"type": "single_machine",
7987
"entrypoint": "dist/index.html"
8088
}
8189
]
@@ -104,8 +112,8 @@ The `applications` field is an array of application objects with the following p
104112
<!-- prettier-ignore -->
105113
| Property | Type | Description |
106114
| ------------ | ------ | ------------------------------------------------------------------------------------------------- |
107-
| `name` | string | The name of your application, which will be a part of the app's URL (`name.publicnamespace.viamapps.com`). For more information on valid names see [](/operate/reference/naming-modules). |
108-
| `type` | string | The type of application (currently only `"web"` is supported). |
115+
| `name` | string | The name of your application, which will be a part of the app's URL (`name_publicnamespace.viamapplications.com`). For more information on valid names see [](/operate/reference/naming-modules). |
116+
| `type` | string | The type of application (currently only `"single_machine"` is supported). |
109117
| `entrypoint` | string | The path to the HTML entry point for your application. The `entrypoint` field specifies the path to your application's entry point. For example: <ul><li><code>"dist/index.html"</code>: Static content rooted at the `dist` directory</li><li><code>"dist/foo.html"</code>: Static content rooted at the `dist` directory, with `foo.html` as the entry point</li><li><code>"dist/"</code>: Static content rooted at the `dist` directory (assumes `dist/index.html` exists)</li><li><code>"dist/bar/foo.html"</code>: Static content rooted at `dist/bar` with `foo.html` as the entry point</li></ul> |
110118

111119
{{% /tablestep %}}
@@ -114,10 +122,11 @@ The `applications` field is an array of application objects with the following p
114122
**Package your app into a module and upload it** to the Viam Registry:
115123

116124
TODO: first command doesn't make sense
125+
don't use module generate
117126

118127
```sh {class="command-line" data-prompt="$" data-output="3-10"}
119128
viam module build local
120-
viam module upload module.tar.gz
129+
viam module upload module.tar.gz --platform=any
121130
```
122131

123132
TODO: the upload command requires platform & version - is that no longer the case?
@@ -143,10 +152,10 @@ https://your-app-name.your-public-namespace.viamapps.com
143152

144153
Users will be prompted to authenticate with their Viam credentials before accessing your application:
145154

146-
1. User navigates to `your-app-name.your-public-namespace.viamapps.com`
155+
1. User navigates to `your-app-name_your-public-namespace.viamapplications.com`
147156
1. User authenticates with Viam credentials
148157
1. User selects an organization, location, and machine
149-
1. User is redirected to `your-app-name.your-public-namespace.viamapps.com/machine/{machine-id}`
158+
1. User is redirected to `your-app-name_your-public-namespace.viamapplications.com/machine/{machine-id}`
150159
1. Your application is rendered with access to the selected machine
151160

152161
## Limitations
@@ -198,3 +207,5 @@ viam module upload module.tar.gz
198207
```
199208

200209
After the module is approved, your application will be available at `https://my-app.your-public-namespace.viamapps.com`.
210+
211+
https://github.com/bashar-515/sample-app

0 commit comments

Comments
 (0)