Skip to content

Commit 5c40aae

Browse files
authored
Merge pull request #56 from thedodd/bug-fix-in-server
Fix a regression in the server.
2 parents 1e5fd86 + 7939a7b commit 5c40aae

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This changelog follows the patterns described here: https://keepachangelog.com/e
44

55
## Unreleased
66

7+
## 0.5.1
8+
### fixed
9+
- Closes [#55](https://github.com/thedodd/trunk/issues/55): Fixed a regression in the server where the middleware was declared after the handler, and was thus not working as needed. Putting the middleware first fixes the issue.
10+
711
## 0.5.0
812
### added
913
- Added support for proxying requests to arbitrary HTTP backends.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "trunk"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
edition = "2018"
55
description = "Build, bundle & ship your Rust WASM application to the web."
66
license = "MIT/Apache-2.0"

src/serve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ impl ServeSystem {
6262
// Build app.
6363
tide::log::with_level(tide::log::LevelFilter::Error);
6464
let mut app = tide::with_state(State { index });
65-
app.at(&cfg.watch.build.public_url)
66-
.with(IndexHtmlMiddleware)
65+
app.with(IndexHtmlMiddleware)
66+
.at(&cfg.watch.build.public_url)
6767
.serve_dir(cfg.watch.build.dist.to_string_lossy().as_ref())?;
6868

6969
// Build proxies.

0 commit comments

Comments
 (0)