@infodb/revx 0.2.2 → 1.0.0

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.
package/sample/revx.yaml CHANGED
@@ -11,9 +11,6 @@ server:
11
11
 
12
12
  # Global configuration
13
13
  global:
14
- # Request timeout in milliseconds
15
- timeout: 30000
16
-
17
14
  # Max concurrent sockets (can also be set here)
18
15
  # maxSockets: 256
19
16
 
@@ -28,7 +25,6 @@ global:
28
25
  logging:
29
26
  enabled: true
30
27
  format: "combined" # combined | dev | common | short | tiny
31
- level: "info" # error | warn | info | debug
32
28
 
33
29
  # Route definitions
34
30
  routes:
@@ -38,64 +34,19 @@ routes:
38
34
  changeOrigin: true
39
35
  pathRewrite:
40
36
  "^/api": ""
41
- options:
42
- timeout: 5000
43
- headers:
44
- X-Forwarded-Host: "${HOST}"
45
37
 
46
- # Example 2: WebSocket proxy
38
+ # Example 2: WebSocket proxy (critical for HMR)
47
39
  - path: "/ws"
48
40
  target: "ws://localhost:5000"
49
41
  ws: true
50
42
  changeOrigin: true
51
43
 
52
- # Example 3: Load balancing with multiple targets
53
- - path: "/balanced/*"
54
- targets:
55
- - "http://localhost:8001"
56
- - "http://localhost:8002"
57
- - "http://localhost:8003"
58
- strategy: "round-robin" # round-robin | random | ip-hash
59
- pathRewrite:
60
- "^/balanced": ""
61
- healthCheck:
62
- enabled: true
63
- interval: 30000
64
- path: "/health"
65
- timeout: 3000
66
-
67
- # Example 4: Request/Response transformation
68
- - path: "/transform/*"
69
- target: "http://localhost:6000"
70
- changeOrigin: true
71
- transform:
72
- request:
73
- headers:
74
- add:
75
- X-API-Version: "v2"
76
- remove:
77
- - "Cookie"
78
- response:
79
- headers:
80
- add:
81
- X-Proxy-Server: "revx"
82
- remove:
83
- - "Server"
84
-
85
- # Middleware configuration
86
- middleware:
87
- # Request ID middleware
88
- - type: "requestId"
89
- enabled: true
90
- headerName: "X-Request-ID"
91
-
92
- # Compression middleware
93
- - type: "compression"
94
- enabled: true
95
- threshold: 1024
44
+ # Example 3: Static file serving (for Vite build output)
45
+ - path: "/*"
46
+ static: "./dist"
96
47
 
97
- # SSL/TLS settings (optional)
98
- # ssl:
99
- # enabled: false
100
- # key: "/path/to/private.key"
101
- # cert: "/path/to/certificate.crt"
48
+ # Example 4: Proxy to Vite dev server
49
+ # - path: "/*"
50
+ # target: "http://localhost:5173"
51
+ # ws: true # Enable WebSocket for HMR
52
+ # changeOrigin: true