Skip to content

Commit c4a465b

Browse files
committed
feat: bring FileServer logic
1 parent 6cca383 commit c4a465b

File tree

17 files changed

+1981
-10
lines changed

17 files changed

+1981
-10
lines changed

Cargo.lock

Lines changed: 170 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ members = [
77
default-members = ["src/http-server"]
88
resolver = "1"
99

10+
[workspace.package]
11+
authors = ["Leo Borai <[email protected]>"]
12+
categories = ["web-programming", "web-programming::http-server"]
13+
description = "Simple and configurable command-line HTTP server"
14+
documentation = ""
15+
edition = "2024"
16+
include = ["/ui", "/src/"]
17+
keywords = ["configurable", "http", "server", "serve", "static"]
18+
license = "MIT OR Apache-2.0"
19+
repository = "https://github.com/http-server-rs/http-server"
20+
readme = "./README.md"
21+
version = "1.0.0-pre.6fa7635"
22+
1023
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1124

1225
[workspace.dependencies]
@@ -19,6 +32,7 @@ dirs = "5.0.1"
1932
futures = "0.3.31"
2033
gloo = "0.11.0"
2134
gloo-file = "0.3.0"
35+
handlebars = "6.3.2"
2236
humansize = "2.1.3"
2337
http = "1.1.0"
2438
http-body-util = "0.1"

src/http-server/Cargo.toml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[package]
22
name = "http-server"
3-
version = "1.0.0-pre.6fa7635"
4-
authors = ["Leo Borai <[email protected]>"]
5-
edition = "2021"
6-
description = "Simple and configurable command-line HTTP server"
7-
repository = "https://github.com/http-server-rs/http-server"
8-
categories = ["web-programming", "web-programming::http-server"]
9-
keywords = ["configurable", "http", "server", "serve", "static"]
10-
license = "MIT OR Apache-2.0"
11-
readme = "../../README.md"
12-
include = ["/ui", "/src/"]
3+
authors.workspace = true
4+
categories.workspace = true
5+
description.workspace = true
6+
documentation.workspace = true
7+
edition.workspace = true
8+
keywords.workspace = true
9+
include.workspace = true
10+
license.workspace = true
11+
repository.workspace = true
12+
version.workspace = true
1313

1414
[[bin]]
1515
name = "http-server"
@@ -22,8 +22,11 @@ bytes = { workspace = true }
2222
chrono = { workspace = true, features = ["serde"] }
2323
clap = { workspace = true, features = ["env", "derive", "std"] }
2424
dirs = { workspace = true }
25+
futures = { workspace = true }
26+
handlebars = { workspace = true }
2527
http = { workspace = true }
2628
http-body-util = { workspace = true }
29+
humansize = { workspace = true }
2730
hyper = { workspace = true }
2831
hyper-util = { workspace = true, features = ["full"] }
2932
libloading = { workspace = true }

src/http-server/src/cli/command/start.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ impl From<&StartOpt> for Config {
3434
host: val.host,
3535
port: val.port,
3636
cors: val.cors,
37+
legacy_ui: val.legacy_ui,
3738
}
3839
}
3940
}

src/http-server/src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ pub struct Config {
1111
pub port: u16,
1212
/// Enable CORS with a permissive policy.
1313
pub cors: bool,
14+
/// Enable Legacy File Explorer UI.
15+
pub legacy_ui: bool,
1416
}
1517

1618
#[derive(Clone, Debug)]

0 commit comments

Comments
 (0)