-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
I noticed that spin-fileserver currently does not recognize file changes at runtime.
Scenario to Reproduce:
- Create following
spin.toml
cat <<EOF > spin.toml
spin_manifest_version = "1"
authors = ["Christoph Voigt <[email protected]>"]
description = "This Spin application serves static files"
name = "static-server"
trigger = { type = "http", base = "/" }
version = "0.1.0"
[[component]]
source = { url = "https://github.com/fermyon/spin-fileserver/releases/download/v0.0.3/spin_static_fs.wasm", digest = "sha256:38bf971900228222f7f6b2ccee5051f399adca58d71692cdfdea98997965fd0d" }
id = "static-server"
files = [{ source = "content", destination = "/" }]
[component.trigger]
route = "/..."
EOF
- Create directory & file to be served:
$ mkdir -p content
$ cat <<EOF > content/index.html
<html>
<head>
<title>Spin Website</title>
<body>
<h1>Welcome from Spin!</h1>
</body>
</html>
EOF- Serve files & request:
$ spin up
$ curl http://127.0.0.1:3000
<html>
<head>
<title>Hello from Spin</title>
</head>
<body>
<h1>Hello from Spin!</h1>
</body>
</html>- Update index.html
$ cat <<EOF > content/index.html
<html>
<head>
<title>Spin Website</title>
<body>
<h1>Welcome from Spin! - UPDATED</h1>
</body>
</html>
EOF- Request with the result, that the update is not served.
$ curl http://127.0.0.1:3000
<html>
<head>
<title>Hello from Spin</title>
</head>
<body>
<h1>Hello from Spin!</h1>
</body>
</html>Expected behavior:
$ curl http://127.0.0.1:3000
<html>
<head>
<title>Spin Website</title>
<body>
<h1>Welcome from Spin! - UPDATED</h1>
</body>
</html>Of course, I could restart Spin - but I don't think this is a desired workaround.
In a specific use case, I wanted to host Spin in Kubernetes and provide content via a sidecar container. This pattern is currently not possible.
Metadata
Metadata
Assignees
Labels
No labels