Skip to content

Commit eb3de4f

Browse files
authored
Merge pull request #1019 from itowlson/templates-statis-fileserver-new-app-support
Support new static-fileserver apps
2 parents ffb5330 + efaf8ac commit eb3de4f

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
spin_version = "1"
2+
authors = ["{{authors}}"]
3+
description = "{{project-description}}"
4+
name = "{{project-name}}"
5+
trigger = { type = "http", base = "{{http-base}}" }
6+
version = "0.1.0"
7+
8+
[[component]]
9+
source = { url = "https://github.com/fermyon/spin-fileserver/releases/download/v0.0.1/spin_static_fs.wasm", digest = "sha256:650376c33a0756b1a52cad7ca670f1126391b79050df0321407da9c741d32375" }
10+
id = "{{ project-name }}"
11+
files = [ { source = "{{ files-path }}", destination = "/" } ]
12+
[component.trigger]
13+
route = "{{ http-path | http_wildcard }}"

templates/static-fileserver/metadata/spin-template.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ id = "static-fileserver"
33
description = "Serves static files from an asset directory"
44
trigger_type = "http"
55

6-
[new_application]
7-
supported = false
8-
96
[add_component]
7+
skip_files = ["spin.toml"]
8+
skip_parameters = ["http-base", "project-description"]
109
[add_component.snippets]
1110
component = "component.txt"
1211

1312
[parameters]
13+
project-description = { type = "string", prompt = "Project description", default = "" }
14+
http-base = { type = "string", prompt = "HTTP base", default = "/", pattern = "^/\\S*$" }
1415
http-path = { type = "string", prompt = "HTTP path", default = "/static/...", pattern = "^/\\S*$" }
1516
files-path = { type = "string", prompt = "Directory containing the files to serve", default = "assets", pattern = "^\\S+$" }

0 commit comments

Comments
 (0)