Skip to content

Commit 7278023

Browse files
authored
http static assets and websites (windmill-labs#835)
1 parent dba80fe commit 7278023

File tree

2 files changed

+16
-4
lines changed
  • docs
    • core_concepts/39_http_routing
    • getting_started/0_scripts_quickstart/5_sql_quickstart

2 files changed

+16
-4
lines changed

docs/core_concepts/39_http_routing/index.mdx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Custom HTTP routes
22

3-
Windmill supports custom HTTP routes to trigger a script or flow.
3+
Windmill supports custom HTTP routes to trigger runnables or serve static assets and websites.
44
They can only be created by [admins workspace](../../advanced/18_instance_settings/index.mdx#admins-workspace).
55
All properties of the route apart from the http path can be modified by any user with write access to the route.
66

@@ -17,13 +17,15 @@ The full http route takes the following form:
1717
- Self-hosted Windmill: `{base_url}/api/r/{path}`
1818
- Windmill cloud: `https://app.windmill.dev/api/r/{workspace_id}/{path}`
1919

20+
### Triggering a runnable
21+
2022
Select the runnable that should be triggered by this route. To quickly get started, you can use the `create from template` button to generate a runnable template.
2123

2224
Here's an example script:
2325

2426
```TypeScript
2527
export async function main(/* args from the request body */) {
26-
// your code here
28+
// your code here
2729
}
2830
```
2931

@@ -63,4 +65,14 @@ export async function main(user_id: string, name: string, age: number) {
6365

6466
The route also supports additional configuration options:
6567
- **Request type**: Whether the route should return the id (async) or the result (sync) of the runnable.
66-
- **Authentication**: Whether the route should require authentication. If authentication is required, the user needs to have read access to both the route and the runnable.
68+
- **Authentication**: Whether the route should require authentication. If authentication is required, the user needs to have read access to both the route and the runnable.
69+
70+
### Serving static assets and websites
71+
72+
For static assets, upload or specify a file using the S3 picker. The file will be served at the chosen path.
73+
74+
For websites, upload or specify a folder on S3. All its files will be served under the chosen path.
75+
Use the full path as the base URL of your website to ensure relative imports work correctly.
76+
If no file is found at the requested subpath, Windmill will fallback to index.html.
77+
78+

docs/getting_started/0_scripts_quickstart/5_sql_quickstart/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Head to the [Resources](../../../core_concepts/3_resources_and_types/index.mdx)
143143

144144
![Select MySQL Resource Type](./select_mssql.png.webp)
145145

146-
Fill out the form with the information of your MySQL instance and "Test connection" if needed.
146+
Fill out the form with the information of your MS SQL instance and "Test connection" if needed.
147147

148148
![Paste in Resource Values](./fill_mssql.png.webp)
149149

0 commit comments

Comments
 (0)