@browsersync/bslive 0.0.9 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/Cargo.toml +3 -2
  2. package/bslive/src/lib.rs +8 -3
  3. package/bsnext/src/main.rs +9 -3
  4. package/crates/bsnext_client/generated/dto.ts +33 -2
  5. package/crates/bsnext_client/generated/schema.ts +52 -2
  6. package/crates/bsnext_client/{dist → inject/dist}/index.js +105 -58
  7. package/crates/bsnext_client/inject/package.json +12 -0
  8. package/crates/bsnext_client/{ts → inject/src}/index.ts +2 -2
  9. package/crates/bsnext_client/package-lock.json +89 -3
  10. package/crates/bsnext_client/package.json +4 -2
  11. package/crates/bsnext_client/src/lib.rs +10 -0
  12. package/crates/bsnext_client/tsconfig.json +8 -2
  13. package/crates/bsnext_client/ui/dist/index.css +78 -0
  14. package/crates/bsnext_client/ui/dist/index.js +997 -0
  15. package/crates/bsnext_client/{index.html → ui/index.html} +8 -4
  16. package/crates/bsnext_client/ui/input.yml +19 -0
  17. package/crates/bsnext_client/ui/package.json +18 -0
  18. package/crates/bsnext_client/ui/src/components/bs-debug.ts +27 -0
  19. package/crates/bsnext_client/ui/src/components/bs-header.ts +33 -0
  20. package/crates/bsnext_client/ui/src/components/bs-icon.ts +101 -0
  21. package/crates/bsnext_client/ui/src/components/bs-server-detail.ts +21 -0
  22. package/crates/bsnext_client/ui/src/components/bs-server-identity.ts +24 -0
  23. package/crates/bsnext_client/ui/src/components/bs-server-list.ts +39 -0
  24. package/crates/bsnext_client/ui/src/index.ts +39 -0
  25. package/crates/bsnext_client/ui/styles/base.css.ts +17 -0
  26. package/crates/bsnext_client/ui/styles/reset.css +52 -0
  27. package/crates/bsnext_client/ui/styles/style.css +29 -0
  28. package/crates/bsnext_client/ui/svg/wordmark-white.svg +38 -0
  29. package/crates/bsnext_core/Cargo.toml +1 -0
  30. package/crates/bsnext_core/src/common_layers.rs +62 -0
  31. package/crates/bsnext_core/src/dir_loader.rs +1 -1
  32. package/crates/bsnext_core/src/dto.rs +62 -2
  33. package/crates/bsnext_core/src/lib.rs +1 -0
  34. package/crates/bsnext_core/src/not_found/mod.rs +0 -1
  35. package/crates/bsnext_core/src/not_found/not_found_service.rs +5 -11
  36. package/crates/bsnext_core/src/raw_loader.rs +4 -34
  37. package/crates/bsnext_core/src/server/handler_listen.rs +10 -4
  38. package/crates/bsnext_core/src/server/router/assets.rs +39 -0
  39. package/crates/bsnext_core/src/server/router/mod.rs +15 -4
  40. package/crates/bsnext_core/src/server/router/pub_api.rs +39 -0
  41. package/crates/bsnext_core/src/server/router/snapshots/bsnext_core__server__router__tests__test__handlers.snap +9 -0
  42. package/crates/bsnext_core/src/server/router/tests.rs +11 -6
  43. package/crates/bsnext_core/src/server/state.rs +4 -0
  44. package/crates/bsnext_core/src/servers_supervisor/get_servers_handler.rs +3 -2
  45. package/crates/bsnext_core/src/servers_supervisor/start_handler.rs +5 -1
  46. package/crates/bsnext_fs/src/actor.rs +2 -1
  47. package/crates/bsnext_fs/src/filter.rs +14 -5
  48. package/crates/bsnext_fs/src/test/mod.rs +1 -1
  49. package/crates/bsnext_fs/src/watch_path_handler.rs +1 -1
  50. package/crates/bsnext_fs/src/watcher.rs +2 -1
  51. package/crates/bsnext_input/Cargo.toml +3 -0
  52. package/crates/bsnext_input/src/input_test/mod.rs +34 -0
  53. package/crates/bsnext_input/src/input_test/snapshots/bsnext_input__input_test__deserialize_3_headers.snap +29 -0
  54. package/crates/bsnext_input/src/input_test/snapshots/bsnext_input__input_test__deserialize_3_headers_control.snap +25 -0
  55. package/crates/bsnext_input/src/route.rs +4 -0
  56. package/crates/bsnext_output/src/pretty.rs +1 -1
  57. package/crates/bsnext_system/Cargo.toml +1 -1
  58. package/crates/bsnext_system/src/args.rs +4 -0
  59. package/crates/bsnext_system/src/monitor_any_watchables.rs +20 -14
  60. package/crates/bsnext_system/src/start_kind/snapshots/bsnext_system__start_kind__start_from_paths__test__test-2.snap +2 -1
  61. package/crates/bsnext_system/src/start_kind/snapshots/bsnext_system__start_kind__start_from_paths__test__test.snap +2 -1
  62. package/crates/bsnext_tracing/src/lib.rs +42 -4
  63. package/examples/kitchen-sink/input.yml +1 -1
  64. package/package.json +17 -17
  65. package/crates/bsnext_client/style.css +0 -3
  66. package/crates/bsnext_core/src/not_found/not_found.html +0 -20
  67. package/crates/bsnext_core/src/not_found/route_list.rs +0 -49
  68. /package/crates/bsnext_client/{ts → inject/src}/console.ts +0 -0
@@ -1,14 +1,18 @@
1
1
  <!doctype html>
2
2
  <html lang="en">
3
3
  <head>
4
+ <base href="/" />
4
5
  <meta charset="UTF-8">
5
6
  <meta name="viewport"
6
7
  content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
7
8
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
8
- <title>Document</title>
9
- <link rel="stylesheet" href="style.css">
9
+ <title>Browsersync LIVE</title>
10
+ <link rel="stylesheet" href="dist/index.css">
10
11
  </head>
11
12
  <body>
12
- <h1>Hello there</h1>
13
+ <main class="main">
14
+ <div id="app"></div>
15
+ </main>
16
+ <script src="dist/index.js"></script>
13
17
  </body>
14
- </html>
18
+ </html>
@@ -0,0 +1,19 @@
1
+ servers:
2
+ - bind_address: 0.0.0.0:3009
3
+ name: api
4
+ routes:
5
+ - path: /
6
+ html: hello world other
7
+ - bind_address: 0.0.0.0:3007
8
+ routes:
9
+ - path: /
10
+ html: hello world!
11
+ - bind_address: 0.0.0.0:3008
12
+ name: bslive ui
13
+ routes:
14
+ - path: /
15
+ watch: false
16
+ dir: .
17
+ watchers:
18
+ - dir: index.html
19
+ - dir: dist
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@browsersync/bslive-ui",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "description": "",
6
+ "main": "index.js",
7
+ "type": "module",
8
+ "scripts": {
9
+ "build": "esbuild src/index.ts --bundle --outdir=dist --format=esm",
10
+ "dev": "npm run build -- --watch"
11
+ },
12
+ "keywords": [],
13
+ "author": "",
14
+ "license": "ISC",
15
+ "dependencies": {
16
+ "lit": "^3.1.3"
17
+ }
18
+ }
@@ -0,0 +1,27 @@
1
+ import {css, html, LitElement} from "lit";
2
+ import {property} from "lit/decorators.js";
3
+ import {GetServersMessageResponse, ServerDesc, ServerDTO} from "../../../generated/dto";
4
+
5
+ class BsDebug extends LitElement {
6
+ @property({type: Object})
7
+ servers: GetServersMessageResponse = {servers: []};
8
+
9
+ @property({type: Object})
10
+ me: ServerDesc = {routes: [], id: ''}
11
+
12
+ get otherServers(): ServerDTO[] {
13
+ return this.servers.servers
14
+ .filter(server => server.id !== this.me.id)
15
+ }
16
+
17
+ render() {
18
+ return html`
19
+ <bs-header></bs-header>
20
+ <bs-server-detail .server=${this.me}></bs-server-detail>
21
+ ${this.otherServers.length > 0 ? html`
22
+ <bs-server-list .servers=${this.otherServers}></bs-server-list>` : null}
23
+ `
24
+ }
25
+ }
26
+
27
+ customElements.define('bs-debug', BsDebug)
@@ -0,0 +1,33 @@
1
+ import {css, html, LitElement} from "lit";
2
+ import {property} from "lit/decorators.js";
3
+ import {ServerDTO} from "../../../generated/dto";
4
+ import { base } from "../../styles/base.css";
5
+
6
+ class BsHeader extends LitElement {
7
+ @property({type: Object})
8
+ servers: ServerDTO[] = []
9
+
10
+ static styles = [
11
+ base,
12
+ css`
13
+ .logo {
14
+ position: relative;
15
+ color: var(--theme-txt-color);
16
+ }
17
+ .logo bs-icon::part(svg) {
18
+ height: 30px;
19
+ width: 140px;
20
+ }
21
+ `
22
+ ]
23
+
24
+ render() {
25
+ return html`
26
+ <div class="logo">
27
+ <bs-icon icon-name="wordmark"></bs-icon>
28
+ </div>
29
+ `
30
+ }
31
+ }
32
+
33
+ customElements.define('bs-header', BsHeader)
@@ -0,0 +1,101 @@
1
+ import {css, html, LitElement} from "lit";
2
+ import {property} from "lit/decorators.js";
3
+ import {ServerDTO} from "../../../generated/dto";
4
+ import { base } from "../../styles/base.css";
5
+
6
+ class BsIcon extends LitElement {
7
+ @property({type: String, attribute: 'icon-name'})
8
+ iconName!: string;
9
+
10
+ static styles = [
11
+ base,
12
+ css`
13
+ .svg-icon {
14
+ display: inline-block;
15
+ fill: var(--bs-icon-color, currentColor);
16
+ height: var(--bs-icon-height, 1em);
17
+ width: var(--bs-icon-width, 1em);
18
+ vertical-align: middle;
19
+ }
20
+ `
21
+ ]
22
+
23
+ get icon() {
24
+ switch (this.iconName) {
25
+ case "logo": return html`<svg class="svg-icon" part="svg"><use xlink:href="#svg-logo"></use></svg>`
26
+ case "wordmark": return html`<svg class="svg-icon" part="svg"><use xlink:href="#svg-wordmark"></use></svg>`
27
+ default: return `unknown`
28
+ }
29
+ }
30
+
31
+ render() {
32
+ return html`
33
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none">
34
+ <symbol id="svg-check" viewBox="0 0 20 20">
35
+ <path d="M8.294 16.998c-.435 0-.847-.203-1.11-.553l-3.574-4.72c-.465-.614-.344-1.487.27-1.952.615-.467 1.488-.344 1.953.27l2.35 3.104 5.912-9.492c.407-.652 1.267-.852 1.92-.445.654.406.855 1.266.447 1.92L9.478 16.34c-.242.39-.66.635-1.12.656-.022.002-.042.002-.064.002z"/>
36
+ </symbol>
37
+ <symbol id="svg-creative-commons-noncommercial-us" viewBox="0 0 20 20">
38
+ <path d="M9.988.4c2.69 0 4.966.928 6.825 2.784C18.67 5.04 19.6 7.312 19.6 10s-.913 4.936-2.74 6.744C14.923 18.648 12.63 19.6 9.99 19.6c-2.61 0-4.862-.944-6.753-2.832C1.345 14.88.4 12.624.4 10s.945-4.896 2.835-6.816C5.078 1.328 7.33.4 9.988.4zM2.56 7.42c-.287.81-.43 1.67-.43 2.58 0 2.128.777 3.968 2.33 5.52 1.555 1.552 3.405 2.328 5.552 2.328s4.013-.784 5.6-2.352c.53-.513.967-1.073 1.31-1.68l-3.618-1.61c-.246 1.216-1.33 2.04-2.643 2.136v1.48h-1.1v-1.48c-1.078-.013-2.12-.453-2.915-1.15l1.322-1.333c.637.598 1.274.868 2.143.868.563 0 1.188-.22 1.188-.955 0-.26-.1-.44-.26-.577l-.915-.407-1.14-.508c-.563-.252-1.04-.464-1.52-.677L2.56 7.42zm7.452-5.292c-2.18 0-4.02.768-5.527 2.304-.41.414-.766.846-1.07 1.297l3.67 1.632c.332-1.017 1.3-1.635 2.474-1.704v-1.48h1.1v1.48c.76.037 1.593.245 2.413.88l-1.26 1.297c-.466-.33-1.054-.563-1.642-.563-.476 0-1.15.148-1.15.747 0 .09.03.17.086.242l1.228.547.83.37c.532.236 1.04.46 1.542.685l4.92 2.19c.162-.644.244-1.33.244-2.055 0-2.192-.77-4.048-2.307-5.568-1.522-1.536-3.372-2.304-5.55-2.304z"/>
39
+ </symbol>
40
+ <symbol id="svg-back-in-time" viewBox="0 0 20 20">
41
+ <path d="M11 1.8c-4.445 0-8.06 3.56-8.17 7.995V10H.46l3.593 3.894L7.547 10H4.875v-.205C4.982 6.492 7.683 3.85 11 3.85c3.386 0 6.13 2.754 6.13 6.15 0 3.396-2.744 6.15-6.13 6.15-1.357 0-2.61-.445-3.627-1.193L5.967 16.46C7.355 17.55 9.102 18.2 11 18.2c4.515 0 8.174-3.67 8.174-8.2S15.514 1.8 11 1.8zM10 5v5c0 .13.027.26.077.382s.124.233.216.325l3.2 3.2c.283-.183.55-.39.787-.628L12 11V5h-2z"/>
42
+ </symbol>
43
+ <symbol id="svg-time-slot" viewBox="0 0 20 20">
44
+ <path d="M10 .4C4.698.4.4 4.698.4 10s4.298 9.6 9.6 9.6c5.3 0 9.6-4.298 9.6-9.6S15.3.4 10 .4zm0 17.2c-4.197 0-7.6-3.403-7.6-7.6C2.4 5.8 5.802 2.4 10 2.4V10l6.792-3.396c.513 1.023.808 2.173.808 3.396 0 4.197-3.403 7.6-7.6 7.6z"/>
45
+ </symbol>
46
+ <symbol id="svg-merge" viewBox="0 0 20 20">
47
+ <path d="M17.89 17.707L16.892 20c-3.137-1.366-5.496-3.152-6.892-5.275-1.396 2.123-3.755 3.91-6.892 5.275l-.998-2.293C5.14 16.39 8.55 14.102 8.55 10V7H5.5L10 0l4.5 7h-3.05v3c0 4.102 3.41 6.39 6.44 7.707z"/>
48
+ </symbol>
49
+ <symbol id="svg-text" viewBox="0 0 20 20">
50
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M15.5 11h-11c-.275 0-.5.225-.5.5v1c0 .276.225.5.5.5h11c.276 0 .5-.224.5-.5v-1c0-.275-.224-.5-.5-.5zm0-4h-11c-.275 0-.5.225-.5.5v1c0 .276.225.5.5.5h11c.276 0 .5-.224.5-.5v-1c0-.275-.224-.5-.5-.5zm-5 8h-6c-.275 0-.5.225-.5.5v1c0 .276.225.5.5.5h6c.276 0 .5-.224.5-.5v-1c0-.275-.224-.5-.5-.5zm5-12h-11c-.275 0-.5.225-.5.5v1c0 .276.225.5.5.5h11c.276 0 .5-.224.5-.5v-1c0-.275-.224-.5-.5-.5z"/>
51
+ </symbol>
52
+ <symbol id="svg-tv" viewBox="0 0 20 20">
53
+ <path d="M18 1H2C.9 1 0 1.9 0 3v11c0 1.1.882 2.178 1.96 2.393l4.373.875S2.57 19 5 19h10c2.43 0-1.334-1.732-1.334-1.732l4.373-.875C19.116 16.178 20 15.1 20 14V3c0-1.1-.9-2-2-2zm0 13H2V3h16v11z"/>
54
+ </symbol>
55
+ <symbol id="svg-block" viewBox="0 0 20 20">
56
+ <path d="M10 .4C4.697.4.4 4.698.4 10c0 5.303 4.297 9.6 9.6 9.6 5.3 0 9.6-4.297 9.6-9.6 0-5.302-4.3-9.6-9.6-9.6zM2.4 10c0-4.197 3.4-7.6 7.6-7.6 1.828 0 3.505.647 4.816 1.723L4.122 14.817C3.046 13.505 2.4 11.83 2.4 10zm7.6 7.6c-1.83 0-3.506-.647-4.816-1.723L15.878 5.184C16.953 6.496 17.6 8.17 17.6 10c0 4.197-3.404 7.6-7.6 7.6z"/>
57
+ </symbol>
58
+ <symbol id="svg-list" viewBox="0 0 20 20">
59
+ <path d="M14.4 9H8.6c-.552 0-.6.447-.6 1s.048 1 .6 1h5.8c.552 0 .6-.447.6-1s-.048-1-.6-1zm2 5H8.6c-.552 0-.6.447-.6 1s.048 1 .6 1h7.8c.552 0 .6-.447.6-1s-.048-1-.6-1zM8.6 6h7.8c.552 0 .6-.447.6-1s-.048-1-.6-1H8.6c-.552 0-.6.447-.6 1s.048 1 .6 1zM5.4 9H3.6c-.552 0-.6.447-.6 1s.048 1 .6 1h1.8c.552 0 .6-.447.6-1s-.048-1-.6-1zm0 5H3.6c-.552 0-.6.447-.6 1s.048 1 .6 1h1.8c.552 0 .6-.447.6-1s-.048-1-.6-1zm0-10H3.6c-.552 0-.6.447-.6 1s.048 1 .6 1h1.8c.552 0 .6-.447.6-1s-.048-1-.6-1z"/>
60
+ </symbol>
61
+ <symbol id="svg-logo" viewBox="0 0 140 204.1">
62
+ <path d="M63.5.3L1.7 31.2c-1 .5-1.7 1.5-1.7 2.7v136.3c0 1.1.6 2.2 1.7 2.7l61.8 30.9c2 1 4.3-.5 4.3-2.7V3c0-2.2-2.3-3.7-4.3-2.7zM76.5 203.8l61.8-30.9c1-.5 1.7-1.5 1.7-2.7v-66.3c0-1.1-.6-2.2-1.7-2.7L76.5 70.3c-2-1-4.3.5-4.3 2.7v128.1c0 2.2 2.3 3.7 4.3 2.7z"/>
63
+ </symbol>
64
+ <symbol id="svg-wordmark" viewBox="0 0 536.3 106.8">
65
+ <path d="M33 .2L.9 16.2c-.6.3-.9.8-.9 1.4v70.8c0 .6.3 1.1.9 1.4l32.1 16c1 .5 2.3-.2 2.3-1.4V1.6C35.2.4 34-.4 33 .2zM39.7 105.8l32.1-16c.5-.3.9-.8.9-1.4V54c0-.6-.3-1.1-.9-1.4l-32.1-16c-1-.5-2.3.2-2.3 1.4v66.5c.1 1.1 1.3 1.8 2.3 1.3zM129.7 34.8c10.8 0 16.6 4 16.6 14.1 0 6.6-2.1 9.8-6.4 12.2 4.7 1.8 7.8 5.2 7.8 12.6 0 11.1-6.7 15.4-17.3 15.4H109V34.8h20.7zm-11.8 7.6V58h11.7c5.4 0 7.8-2.7 7.8-8 0-5.2-2.7-7.5-8.1-7.5h-11.4zm0 23v16.1h12c5.5 0 8.7-1.7 8.7-8.3 0-6.2-4.6-7.9-8.9-7.9h-11.8zM156.6 49.5h8.6v4.8s6.7-4.4 13.5-5.6v8.6c-7.2 1.4-13.4 6.3-13.4 6.3v25.6h-8.6V49.5zM365.4 49.5h8.6v4.8s6.7-4.4 13.5-5.6v8.6c-7.2 1.4-13.4 6.3-13.4 6.3v25.6h-8.6V49.5zM218.4 69.1c0 13.2-4 20.9-17.7 20.9-13.6 0-17.7-7.8-17.7-20.9 0-12.9 4.4-20.5 17.7-20.5s17.7 7.6 17.7 20.5zm-8.7 0c0-9.2-2-13.2-9-13.2s-9 4-9 13.2 1.6 13.6 9 13.6 9-4.4 9-13.6zM232.3 49.5l6.3 32.3h1.6l7.5-31.5h8.9l7.5 31.5h1.6l6.2-32.3h8.6l-8.4 39.7h-13.7L252.2 62 246 89.2h-13.7l-8.4-39.7h8.4zM315.4 57.7s-9.4-1.3-14.1-1.3c-4.8 0-6.9 1.1-6.9 4.4 0 2.6 1.7 3.3 9.4 4.7 9.5 1.7 12.9 4 12.9 12 0 9.3-5.9 12.6-15.7 12.6-5.5 0-14.7-1.7-14.7-1.7l.3-7.2s9.5 1.3 13.6 1.3c5.7 0 7.9-1.2 7.9-4.7 0-2.8-1.3-3.6-9.2-4.9-8.7-1.4-13.2-3.3-13.2-11.7 0-9 7-12.3 14.8-12.3 5.8 0 14.9 1.7 14.9 1.7v7.1zM355.6 81.8l.2 6.4s-9 1.8-16 1.8c-11.9 0-16.5-6.3-16.5-20.3 0-14.5 6.3-21.1 17.2-21.1 11.1 0 16.7 5.8 16.7 18.2l-.6 6.2H332c.1 6.3 2.5 9.5 9 9.5 6.2 0 14.6-.7 14.6-.7zm-7-15.5c0-7.9-2.4-10.6-8.2-10.6-5.9 0-8.5 2.9-8.6 10.6h16.8zM420.5 54.3S412 53 406.8 53c-4.9 0-9.4 1.3-9.4 6.7 0 4.1 2 5.3 10.6 6.7 10.2 1.7 14 3.5 14 11.1 0 9.3-5.8 12.3-15.3 12.3-4.8 0-13.6-1.4-13.6-1.4l.3-4.2s8.9 1.3 12.9 1.3c6.8 0 10.8-1.6 10.8-7.8 0-4.8-2.4-5.8-11.3-7.1-9.1-1.4-13.3-3.1-13.3-10.8 0-8.6 7.1-11.2 14-11.2 6 0 14 1.3 14 1.3v4.4zM432 49.5L442.5 85h2.9L456 49.5h4.8l-16.9 57.3h-4.8l5.1-17.7h-5.5L427 49.4h5zM468.9 89.2V49.5h4.7v2.9s6.7-3.7 12.9-3.7c10.9 0 13.3 5.1 13.3 19.6v20.9H495V68.5c0-11.7-1.3-15.6-9.2-15.6-6.2 0-12.2 3.3-12.2 3.3V89h-4.7zM536.2 49.7l-.2 4s-6.3-.8-9.3-.8c-9.5 0-12.3 4.2-12.3 15.6 0 12.5 1.9 17.1 12.3 17.1 3 0 9.4-.7 9.4-.7l.2 4s-7.1 1-10.5 1c-12.9 0-16.3-5.7-16.3-21.3 0-14.5 4.6-19.9 16.4-19.9 3.4 0 10.3 1 10.3 1z"/>
66
+ </symbol>
67
+ <symbol id="svg-github" viewBox="0 0 32 32">
68
+ <path clip-rule="evenodd" d="M16.003 0C7.17 0 .008 7.162.008 15.997c0 7.067 4.582 13.063 10.94 15.18.8.145 1.052-.33 1.052-.753 0-.38.008-1.442 0-2.777-4.45.967-5.37-2.107-5.37-2.107-.728-1.848-1.776-2.34-1.776-2.34-1.452-.992.11-.973.11-.973 1.604.113 2.45 1.65 2.45 1.65 1.427 2.442 3.743 1.736 4.654 1.328.146-1.034.56-1.74 1.017-2.14C9.533 22.663 5.8 21.29 5.8 15.16c0-1.747.622-3.174 1.645-4.292-.165-.404-.715-2.03.157-4.234 0 0 1.343-.43 4.398 1.64 1.276-.354 2.645-.53 4.005-.537 1.36.006 2.727.183 4.005.538 3.055-2.07 4.396-1.64 4.396-1.64.872 2.202.323 3.83.16 4.233 1.022 1.118 1.643 2.545 1.643 4.292 0 6.146-3.74 7.498-7.305 7.893C19.48 23.548 20 24.508 20 26v4.428c0 .428.258.9 1.07.746C27.422 29.054 32 23.062 32 15.997 32 7.162 24.838 0 16.003 0z" fill-rule="evenodd"/>
69
+ </symbol>
70
+ <symbol id="svg-twitter" viewBox="0 0 273.4 222.2">
71
+ <path d="M273.4 26.3c-10.1 4.5-20.9 7.5-32.2 8.8 11.6-6.9 20.5-17.9 24.7-31-10.9 6.4-22.9 11.1-35.7 13.6C220 6.8 205.4 0 189.3 0c-31 0-56.1 25.1-56.1 56.1 0 4.4.5 8.7 1.5 12.8C88 66.5 46.7 44.2 19 10.3c-4.8 8.3-7.6 17.9-7.6 28.2 0 19.5 9.9 36.6 25 46.7-9.2-.3-17.8-2.8-25.4-7v.7c0 27.2 19.3 49.8 45 55-4.7 1.3-9.7 2-14.8 2-3.6 0-7.1-.4-10.6-1 7.1 22.3 27.9 38.5 52.4 39-19.2 15-43.4 24-69.7 24-4.5 0-9-.3-13.4-.8 24.8 15.9 54.3 25.2 86 25.2 103.2 0 159.6-85.5 159.6-159.6 0-2.4-.1-4.9-.2-7.3 11.1-8 20.6-17.9 28.1-29.1z"/>
72
+ </symbol>
73
+ <symbol id="svg-circle-play" viewBox="0 0 191.4 191.4">
74
+ <circle fill="none" stroke="#FFF" stroke-width="22" stroke-miterlimit="10" cx="95.7" cy="95.7" r="84.7"/>
75
+ <path d="M87.8 57l46.7 32.6c4.2 3 4.2 9.2 0 12.2l-45.3 31.6c-4.7 3.3-11.1-.1-11.1-5.8V62c0-4.9 5.6-7.9 9.7-5z"/>
76
+ </symbol>
77
+ <symbol id="svg-code" viewBox="0 0 20 20">
78
+ <path d="M5.72 14.75c-.237 0-.475-.083-.665-.252L-.005 10l5.34-4.748c.413-.365 1.045-.33 1.412.083.367.413.33 1.045-.083 1.412L3.004 10l3.38 3.002c.412.367.45 1 .082 1.412-.197.223-.472.336-.747.336zm8.944-.002L20.004 10l-5.06-4.498c-.412-.367-1.044-.33-1.41.083-.367.413-.33 1.045.083 1.412L16.995 10l-3.66 3.252c-.412.367-.45 1-.082 1.412.197.223.472.336.747.336.236 0 .474-.083.664-.252zm-4.678 1.417l2-12c.09-.545-.277-1.06-.822-1.15-.547-.093-1.06.276-1.15.82l-2 12c-.09.546.277 1.06.822 1.152.056.01.11.013.165.013.48 0 .905-.347.986-.835z"/>
79
+ </symbol>
80
+ <symbol id="svg-menu" viewBox="0 0 20 20">
81
+ <path d="M16.4 9H3.6c-.552 0-.6.447-.6 1 0 .553.048 1 .6 1h12.8c.552 0 .6-.447.6-1 0-.553-.048-1-.6-1zm0 4H3.6c-.552 0-.6.447-.6 1 0 .553.048 1 .6 1h12.8c.552 0 .6-.447.6-1 0-.553-.048-1-.6-1zM3.6 7h12.8c.552 0 .6-.447.6-1 0-.553-.048-1-.6-1H3.6c-.552 0-.6.447-.6 1 0 .553.048 1 .6 1z"/>
82
+ </symbol>
83
+ <symbol id="svg-cross" viewBox="0 0 20 20">
84
+ <path d="M14.348 14.85c-.47.468-1.23.468-1.697 0L10 11.82l-2.65 3.028c-.47.47-1.23.47-1.698 0-.47-.47-.47-1.23 0-1.697L8.41 10 5.65 6.85c-.468-.47-.468-1.23 0-1.698.47-.47 1.23-.47 1.698 0L10 8.182l2.65-3.03c.47-.47 1.23-.47 1.698 0 .47.47.47 1.23 0 1.697L11.59 10l2.758 3.15c.47.47.47 1.23 0 1.7z"/>
85
+ </symbol>
86
+ <symbol id="svg-typeface-reg" viewBox="0 0 113.8 77.2">
87
+ <path d="M20.9 0h18.5l20.9 76.1h-8.4l-5.5-19.6H13.9L8.4 76.1H0L20.9 0zm-5.2 49h28.8L33 7.3h-5.7L15.7 49zM107.5 65.9c.2 3.2 2.9 4.4 6.4 4.8l-.3 6.5c-5.8 0-9.8-1.1-13.1-4.4 0 0-9.9 4.4-19.8 4.4-10 0-15.5-5.7-15.5-16.8 0-10.6 5.5-15.2 16.8-16.3l17.3-1.6v-4.7c0-7.7-3.3-10.5-9.9-10.5-7.7 0-20.8 1.4-20.8 1.4l-.3-6.3S80.4 20 89.9 20c12.4 0 17.7 5.7 17.7 17.7v28.2zM82.9 50.3c-6.7.7-9.4 3.9-9.4 9.9 0 6.4 2.8 10.1 8.4 10.1 8.1 0 17.3-3.4 17.3-3.4V48.7l-16.3 1.6z"/>
88
+ </symbol>
89
+ <symbol id="svg-typeface-bold" viewBox="0 0 114.3 76.6">
90
+ <path d="M18.6 0h24.3l18.7 75.4H49.3l-4.1-16.2H16.3l-4.1 16.2H0L18.6 0zm.1 48.4h24.1l-9.2-38.2H28l-9.3 38.2zM109.5 62.4c.2 3.3 1.7 4.6 4.8 5.1l-.3 9.1c-6.7 0-10.6-.9-14.6-4.1 0 0-8.8 4.1-17.7 4.1-10.9 0-16.4-6-16.4-17.5 0-11.7 6.4-15.6 18.1-16.6l14.2-1.2v-4c0-6.1-2.6-7.9-8-7.9-7.4 0-20.7 1.1-20.7 1.1l-.5-8.5s12-2.9 22.1-2.9c13.4 0 18.9 5.6 18.9 18.2v25.1zM84.8 50.9c-5.1.4-7.6 2.9-7.6 7.8s2.1 8 6.7 8c6.3 0 13.6-2.4 13.6-2.4V49.7l-12.7 1.2z"/>
91
+ </symbol>
92
+ <symbol id="svg-typeface-thin" viewBox="0 0 113.3 78">
93
+ <path d="M23.6 0h11.7L59 77h-4l-7.2-23.6H11.1L4 77H0L23.6 0zM12.3 49.6h34.3l-14-45.9h-6.2L12.3 49.6zM105 69.9c.3 3.2 4.4 4.3 8.2 4.6l-.2 3.4c-4.7 0-8.9-1.2-11.3-4.6 0 0-11.2 4.7-22.2 4.7-9 0-14.4-5.4-14.4-16.1 0-9.3 4.4-14.7 15.2-15.8l20.9-2.2v-5.7c0-9.6-4.2-13.4-12.2-13.4s-20.8 1.9-20.8 1.9l-.3-3.7s12.3-2 21.1-2c11.1 0 16.1 5.8 16.1 17.2v31.7zM80.7 49.5c-8.6.9-11.5 4.8-11.5 12.4 0 8 3.7 12.5 10.5 12.5 10.3 0 21.6-4.5 21.6-4.5V47.4l-20.6 2.1z"/>
94
+ </symbol>
95
+ </svg>
96
+ ${this.icon}
97
+ `
98
+ }
99
+ }
100
+
101
+ customElements.define('bs-icon', BsIcon)
@@ -0,0 +1,21 @@
1
+ import {css, html, LitElement} from "lit";
2
+ import {property} from "lit/decorators.js";
3
+ import {ServerDesc, ServerDTO} from "../../../generated/dto";
4
+ import {base} from "../../styles/base.css";
5
+
6
+ class BsServerDetail extends LitElement {
7
+ @property({type: Object})
8
+ server: ServerDesc = { routes: [], id: '' }
9
+
10
+ static styles = [
11
+ base
12
+ ]
13
+
14
+ render() {
15
+ return html`
16
+ <pre><code>${JSON.stringify(this.server, null, 2)}</code></pre>
17
+ `
18
+ }
19
+ }
20
+
21
+ customElements.define('bs-server-detail', BsServerDetail)
@@ -0,0 +1,24 @@
1
+ import { html, LitElement} from "lit";
2
+ import {property} from "lit/decorators.js";
3
+ import {IdentityDTO} from "../../../generated/dto";
4
+ import {base} from "../../styles/base.css";
5
+
6
+ class BsServerIdentity extends LitElement {
7
+ @property({type: Object})
8
+ identity!: IdentityDTO
9
+
10
+ static styles = [base];
11
+
12
+ render() {
13
+ switch (this.identity.kind) {
14
+ case "Named":
15
+ case "Both": {
16
+ return html`<p><strong>[named] ${this.identity.payload.name}</strong></p>`
17
+ }
18
+ default:
19
+ return html`<p><strong>[unnamed]</strong></p>`
20
+ }
21
+ }
22
+ }
23
+
24
+ customElements.define('bs-server-identity', BsServerIdentity)
@@ -0,0 +1,39 @@
1
+ import {css, html, LitElement} from "lit";
2
+ import {property} from "lit/decorators.js";
3
+ import {ServerDTO} from "../../../generated/dto";
4
+ import { base } from "../../styles/base.css";
5
+
6
+ class BsServerList extends LitElement {
7
+ @property({type: Object})
8
+ servers: ServerDTO[] = []
9
+
10
+ static styles = [
11
+ base,
12
+ css`
13
+
14
+ `
15
+ ]
16
+
17
+ render() {
18
+ return html`
19
+ ${this.servers
20
+ .map(server => {
21
+ const display_addr = 'http://' + server.socket_addr;
22
+ let url = new URL(display_addr);
23
+ let bs_url = new URL('./__bslive', display_addr);
24
+ return html`
25
+ <div>
26
+ <bs-server-identity .identity=${server.identity}></bs-server-identity>
27
+ <p><a href=${url} target="_blank"><code>${url}</code></a></p>
28
+ <p>
29
+ <bs-icon icon-name="logo"></bs-icon>
30
+ <small><a href=${bs_url} target="_blank"><code>${bs_url}</code></a></small>
31
+ </p>
32
+ </div>
33
+ `
34
+ })}
35
+ `
36
+ }
37
+ }
38
+
39
+ customElements.define('bs-server-list', BsServerList)
@@ -0,0 +1,39 @@
1
+ import "../styles/style.css";
2
+ import "./components/bs-debug";
3
+ import "./components/bs-server-list";
4
+ import "./components/bs-server-detail";
5
+ import "./components/bs-server-identity";
6
+ import "./components/bs-header";
7
+ import "./components/bs-icon";
8
+ import {GetServersMessageResponse, ServerDesc} from "../../generated/dto";
9
+ import {html, render} from "lit";
10
+
11
+ const all = fetch('/__bs_api/servers').then(x => x.json())
12
+ const me = fetch('/__bs_api/me').then(x => x.json())
13
+
14
+ Promise.all([all, me])
15
+ .then(([servers, me]: [GetServersMessageResponse, ServerDesc]) => {
16
+ let next = html`<bs-debug .servers=${servers} .me=${me}></bs-debug>`
17
+ let app = document.querySelector('#app') as HTMLElement;
18
+ if (!app) throw new Error('cannot...');
19
+ // console.log(x);
20
+ render(next, app);
21
+ // for (let route of x.routes) {
22
+ // switch (route.kind.kind) {
23
+ // case "Html":
24
+ // break;
25
+ // case "Json":
26
+ // break;
27
+ // case "Raw":
28
+ // break;
29
+ // case "Sse":
30
+ // break;
31
+ // case "Proxy":
32
+ // break;
33
+ // case "Dir":
34
+ // break;
35
+ //
36
+ // }
37
+ // }
38
+ })
39
+ .catch(console.error)
@@ -0,0 +1,17 @@
1
+ import {css} from "lit";
2
+
3
+ export const base = css`
4
+ pre {
5
+ margin: 0
6
+ }
7
+ a {
8
+ color: var(--theme-txt-color);
9
+ &:hover {
10
+ text-decoration: none;
11
+ }
12
+ }
13
+ p {
14
+ margin: 0;
15
+ padding: 0;
16
+ }
17
+ `
@@ -0,0 +1,52 @@
1
+ /*
2
+ 1. Use a more-intuitive box-sizing model.
3
+ */
4
+ *, *::before, *::after {
5
+ box-sizing: border-box;
6
+ }
7
+
8
+ /*
9
+ 2. Remove default margin
10
+ */
11
+ * {
12
+ margin: 0;
13
+ }
14
+
15
+ /*
16
+ Typographic tweaks!
17
+ 3. Add accessible line-height
18
+ 4. Improve text rendering
19
+ */
20
+ body {
21
+ line-height: 1.5;
22
+ -webkit-font-smoothing: antialiased;
23
+ }
24
+
25
+ /*
26
+ 5. Improve media defaults
27
+ */
28
+ img, picture, video, canvas, svg {
29
+ display: block;
30
+ max-width: 100%;
31
+ }
32
+
33
+ /*
34
+ 6. Remove built-in form typography styles
35
+ */
36
+ input, button, textarea, select {
37
+ font: inherit;
38
+ }
39
+
40
+ /*
41
+ 7. Avoid text overflows
42
+ */
43
+ p, h1, h2, h3, h4, h5, h6 {
44
+ overflow-wrap: break-word;
45
+ }
46
+
47
+ /*
48
+ 8. Create a root stacking context
49
+ */
50
+ #root, #__next {
51
+ isolation: isolate;
52
+ }
@@ -0,0 +1,29 @@
1
+ @import url("./reset.css");
2
+ :root {
3
+ --brand-blue: #0F2634;
4
+ --brand-grey: #6D6D6D;
5
+ --brand-red: #F24747;
6
+ --brand-white: #FFFFFF;
7
+
8
+ --theme-txt-color: var(--brand-blue);
9
+ --theme-page-color: var(--brand-white);
10
+ }
11
+
12
+ body {
13
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
14
+ color: var(--theme-txt-color);
15
+ background: var(--theme-page-color);
16
+ }
17
+ svg:not(:root) {
18
+ overflow: hidden;
19
+ }
20
+ .main {
21
+ padding-left: 1em;
22
+ padding-right: 1em;
23
+ }
24
+ @media (prefers-color-scheme: dark) {
25
+ :root {
26
+ --theme-txt-color: var(--brand-white);
27
+ --theme-page-color: var(--brand-blue);
28
+ }
29
+ }
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ viewBox="0 0 400 400" enable-background="new 0 0 400 400" xml:space="preserve">
6
+ <g>
7
+ <path fill="#FFFFFF" d="M27.3,150.9L3.7,162.7c-0.4,0.2-0.6,0.6-0.6,1v52c0,0.4,0.2,0.8,0.6,1l23.6,11.8c0.8,0.4,1.7-0.2,1.7-1
8
+ v-75.5C29,151.1,28.1,150.5,27.3,150.9z"/>
9
+ <path fill="#FFFFFF" d="M32.3,228.5l23.6-11.8c0.4-0.2,0.6-0.6,0.6-1v-25.3c0-0.4-0.2-0.8-0.6-1l-23.6-11.8c-0.8-0.4-1.7,0.2-1.7,1
10
+ v48.8C30.6,228.3,31.5,228.9,32.3,228.5z"/>
11
+ <g>
12
+ <path fill="#FFFFFF" d="M98.3,176.3c7.9,0,12.2,3,12.2,10.4c0,4.8-1.5,7.2-4.7,9c3.4,1.3,5.7,3.8,5.7,9.3c0,8.2-5,11.3-12.7,11.3
13
+ H83.2v-39.9H98.3z M89.6,181.9v11.4h8.6c4,0,5.7-2,5.7-5.9c0-3.8-2-5.5-5.9-5.5H89.6z M89.6,198.8v11.8h8.8c4,0,6.4-1.3,6.4-6.1
14
+ c0-4.5-3.4-5.8-6.5-5.8H89.6z"/>
15
+ <path fill="#FFFFFF" d="M118.1,187.1h6.3v3.5c0,0,5-3.2,9.9-4.1v6.4c-5.3,1-9.8,4.6-9.8,4.6v18.8h-6.4V187.1z"/>
16
+ <path fill="#FFFFFF" d="M271.4,187.1h6.3v3.5c0,0,5-3.2,9.9-4.1v6.4c-5.3,1-9.8,4.6-9.8,4.6v18.8h-6.4V187.1z"/>
17
+ <path fill="#FFFFFF" d="M163.5,201.5c0,9.7-3,15.4-13,15.4c-10,0-13-5.7-13-15.4c0-9.4,3.3-15,13-15
18
+ C160.2,186.5,163.5,192.1,163.5,201.5z M157,201.5c0-6.8-1.5-9.7-6.6-9.7c-5.1,0-6.6,2.9-6.6,9.7c0,6.8,1.2,10,6.6,10
19
+ C155.9,211.5,157,208.3,157,201.5z"/>
20
+ <path fill="#FFFFFF" d="M173.7,187.1l4.6,23.7h1.2l5.5-23.1h6.5l5.5,23.1h1.2l4.5-23.7h6.3l-6.2,29.1h-10.1l-4.5-20l-4.5,20h-10.1
21
+ l-6.2-29.1H173.7z"/>
22
+ <path fill="#FFFFFF" d="M234.7,193.1c0,0-6.9-0.9-10.4-0.9c-3.5,0-5.1,0.8-5.1,3.2c0,1.9,1.2,2.4,6.9,3.4c7,1.2,9.5,3,9.5,8.8
23
+ c0,6.8-4.3,9.3-11.5,9.3c-4,0-10.8-1.3-10.8-1.3l0.2-5.3c0,0,7,0.9,10,0.9c4.2,0,5.8-0.9,5.8-3.4c0-2-1-2.7-6.8-3.6
24
+ c-6.4-1-9.7-2.4-9.7-8.6c0-6.6,5.1-9,10.9-9c4.3,0,11,1.3,11,1.3L234.7,193.1z"/>
25
+ <path fill="#FFFFFF" d="M264.2,210.8l0.1,4.7c0,0-6.6,1.3-11.8,1.3c-8.7,0-12.1-4.7-12.1-14.9c0-10.7,4.6-15.5,12.6-15.5
26
+ c8.2,0,12.2,4.3,12.2,13.3l-0.4,4.5h-18.1c0.1,4.7,1.8,7,6.6,7C258.1,211.4,264.2,210.8,264.2,210.8z M259.1,199.5
27
+ c0-5.8-1.7-7.7-6-7.7c-4.3,0-6.2,2.2-6.3,7.7H259.1z"/>
28
+ <path fill="#FFFFFF" d="M311.8,190.7c0,0-6.2-0.9-10.1-0.9c-3.6,0-6.9,1-6.9,5c0,3,1.5,3.9,7.8,5c7.5,1.2,10.3,2.6,10.3,8.2
29
+ c0,6.8-4.3,9-11.2,9c-3.6,0-10-1-10-1l0.2-3.1c0,0,6.5,1,9.5,1c5,0,7.9-1.2,7.9-5.7c0-3.5-1.7-4.3-8.3-5.2c-6.7-1-9.8-2.3-9.8-7.9
30
+ c0-6.4,5.2-8.2,10.3-8.2c4.4,0,10.3,1,10.3,1L311.8,190.7z"/>
31
+ <path fill="#FFFFFF" d="M320.3,187.1l7.7,26.1h2.1l7.8-26.1h3.6l-12.4,42.1h-3.5l3.8-13h-4l-8.6-29.1H320.3z"/>
32
+ <path fill="#FFFFFF" d="M347.4,216.3v-29.1h3.4v2.2c0,0,4.9-2.7,9.5-2.7c8,0,9.7,3.7,9.7,14.4v15.3h-3.5v-15.1
33
+ c0-8.6-0.9-11.4-6.8-11.4c-4.5,0-9,2.4-9,2.4v24.1H347.4z"/>
34
+ <path fill="#FFFFFF" d="M396.8,187.3l-0.2,3c0,0-4.6-0.6-6.8-0.6c-7,0-9,3.1-9,11.5c0,9.1,1.4,12.5,9,12.5c2.2,0,6.9-0.5,6.9-0.5
35
+ l0.1,3c0,0-5.2,0.7-7.7,0.7c-9.4,0-12-4.2-12-15.7c0-10.7,3.4-14.6,12.1-14.6C391.8,186.5,396.8,187.3,396.8,187.3z"/>
36
+ </g>
37
+ </g>
38
+ </svg>
@@ -20,6 +20,7 @@ matchit = { version = "0.7.3" }
20
20
  htmlescape = { version = "0.3.1" }
21
21
 
22
22
  mime_guess = { workspace = true }
23
+ insta = { workspace = true }
23
24
  axum = { workspace = true }
24
25
  clap = { workspace = true }
25
26
  http-body-util = { workspace = true }
@@ -0,0 +1,62 @@
1
+ use axum::extract::Request;
2
+ use axum::middleware::Next;
3
+ use axum::{middleware, Router};
4
+ use http::{HeaderName, HeaderValue};
5
+ use std::convert::Infallible;
6
+ use std::time::Duration;
7
+
8
+ use bsnext_input::route::{CorsOpts, DelayKind, DelayOpts, Route};
9
+ use tokio::time::sleep;
10
+ use tower_http::cors::CorsLayer;
11
+ use tower_http::set_header;
12
+
13
+ pub fn add_route_layers(app: Router, route: &Route) -> Router {
14
+ let mut app = app;
15
+
16
+ if route
17
+ .cors_opts
18
+ .as_ref()
19
+ .is_some_and(|v| *v == CorsOpts::Cors(true))
20
+ {
21
+ tracing::trace!(to = route.path, "adding permissive cors");
22
+ app = app.layer(CorsLayer::permissive());
23
+ }
24
+
25
+ if let Some(DelayOpts::Delay(DelayKind::Ms(ms))) = route.delay_opts.as_ref() {
26
+ tracing::trace!(to = route.path, ?ms, "adding a delay");
27
+ let ms = *ms;
28
+ app = app.layer(middleware::from_fn(
29
+ move |req: Request, next: Next| async move {
30
+ let res = next.run(req).await;
31
+ sleep(Duration::from_millis(ms)).await;
32
+ Ok::<_, Infallible>(res)
33
+ },
34
+ ));
35
+ }
36
+
37
+ if let Some(headers) = route.headers.as_ref() {
38
+ for (k, v) in headers {
39
+ let hn = HeaderName::from_bytes(k.as_bytes());
40
+ let hv = HeaderValue::from_bytes(v.as_bytes());
41
+ match (hn, hv) {
42
+ (Ok(n), Ok(v)) => {
43
+ app = app.layer(set_header::SetResponseHeaderLayer::overriding(n, v));
44
+ }
45
+ (Ok(_), Err(_e)) => {
46
+ tracing::error!("invalid header value `{}`", v)
47
+ }
48
+ (Err(_e), Ok(_)) => {
49
+ tracing::error!("invalid header name `{}`", k)
50
+ }
51
+ (Err(_e), Err(_e2)) => {
52
+ tracing::error!("invalid header name AND value `{}:{}`", k, v)
53
+ }
54
+ }
55
+ }
56
+ }
57
+ // if route.opts.as_ref().is_some_and(|v| v.buff) {
58
+ // app = app.layer(middleware::from_fn(print_request_response));
59
+ // }
60
+
61
+ app
62
+ }
@@ -2,7 +2,6 @@
2
2
  #![allow(clippy::single_match)]
3
3
  use crate::handlers::proxy::ProxyConfig;
4
4
  use crate::meta::MetaData;
5
- use crate::raw_loader::add_route_layers;
6
5
  use axum::body::Body;
7
6
  use axum::extract::{Request, State};
8
7
 
@@ -13,6 +12,7 @@ use bytes::Bytes;
13
12
  use futures::channel::mpsc::unbounded;
14
13
  use futures::SinkExt;
15
14
 
15
+ use crate::common_layers::add_route_layers;
16
16
  use crate::handlers::proxy;
17
17
  use crate::server::state::ServerState;
18
18
  use axum::routing::any;