Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tokio = { version = "1", features = ["full"] }
tokio-stream = { version = "0.1.15", features = ["sync"] }
futures = "0.3.30"
futures-util = { version = "0.3", default-features = false, features = ["sink", "std"] }
tower = { version = "0.4", features = ['steer'] }
tower = { version = "0.4", features = ['steer', 'util'] }
tower-http = { version = "0.6.0", features = ['trace', 'fs', 'compression-full', 'decompression-full', 'catch-panic', 'cors', 'timeout', 'set-header', ] }
tracing = { version = "0.1.35", default-features = false, features = ["std", "attributes"] }
actix = "0.13.1"
Expand Down
60 changes: 41 additions & 19 deletions _bslive.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
servers:
- port: 3000
clients:
log: trace
watchers:
- dir: crates
run:
- sh: cargo build
- port: 3003
routes:
- path: /api
proxy: https://example.com
rewrite_uri: false
inject:
- append: 'abc'
only: /index.html
- port: 3002
routes:
- path: /
html: lol
- path: /api
json: [ 1,2 ]
when:
query:
has: 'mock'
- path: /api
proxy: https://duckduckgo.github.io
- port: 3001
routes:
- path: /a/really/:long/path
dir: examples/basic/public
- path: /shane
raw: "here2"
when:
- query:
has: 'abc'
- path: /shane
raw: "here"
when:
- query:
has: 'def'
- path: /shane
dir: examples/basic/public
watch:
debounce:
ms: 300
run:
- all:
- sh: echo 2
- sh: exit 0
- sh: sleep 1 && echo '->hehe'
name: '[another attempt--->]'
- seq:
- sleep 1
- echo 'after?'
- path: /shane
dir: examples/html
- path: /
html: "4"
when:
- query:
is: 'a=b'
- path: /
html: "3"
2 changes: 1 addition & 1 deletion crates/bsnext_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub const WS_PATH: &str = "/__bs_ws";

pub fn html_with_base(base_override: &str) -> String {
let base = UI_HTML;
let next = format!("<base href=\"{}\" />", base_override);
let next = format!("<base href=\"{base_override}\" />");
let replaced = base.replace("<base href=\"/\" />", next.as_str());
replaced
}
Expand Down
1 change: 1 addition & 0 deletions crates/bsnext_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ serde_yaml = { workspace = true }
serde_json = { workspace = true }
bytes = { workspace = true }
http = { workspace = true }
log = "0.4.21"

[[example]]
name = "abc"
6 changes: 3 additions & 3 deletions crates/bsnext_core/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ impl OutputWriterTrait for ExportError {
"kind": named,
"error": error_string
});
writeln!(_sink, "{}", v)?;
writeln!(_sink, "{v}")?;
Ok(())
}

fn write_pretty<W: Write>(&self, sink: &mut W) -> anyhow::Result<()> {
match self {
ExportError::Fs(fs_write_error) => {
writeln!(sink, "[export]: Error! {}", fs_write_error)?;
writeln!(sink, "[export]: Error! {fs_write_error}")?;
}
}
Ok(())
Expand All @@ -55,7 +55,7 @@ impl OutputWriterTrait for ExportError {
impl OutputWriterTrait for ExportEvent {
fn write_json<W: Write>(&self, _sink: &mut W) -> anyhow::Result<()> {
let str = serde_json::to_string(&self)?;
writeln!(_sink, "{}", str)?;
writeln!(_sink, "{str}")?;
Ok(())
}

Expand Down
Loading
Loading