File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ To register a service with the gateway to make it available for use from the [Tu
66``` toml
77[services .name ] # where 'name' is a unique kebab-case name for your service
88path =" /myservice" # unique path the frontend will make a request to at /api[path]
9- target_service =" https://my-service.default.svc.cluster.local" # the host for the service
9+ target_host =" https://my-service.default.svc.cluster.local" # the host for the service
1010target_port =8080 # the target port for your service
1111```
1212- add an entry for your service in the list below with a brief description of your service and a link to the documentation
Original file line number Diff line number Diff line change 11use serde:: { Deserialize , Serialize } ;
2+ use std:: collections:: HashMap ;
23use std:: { fs:: File , io:: Read } ;
3- use toml;
44
55#[ derive( Serialize , Deserialize , Debug , Clone ) ]
66pub struct ServiceConfig {
77 pub path : String ,
8- pub target_service : String ,
8+ pub target_host : String ,
99 pub target_port : u32 ,
1010}
1111
1212#[ derive( Serialize , Deserialize , Debug , Clone ) ]
1313pub struct GatewayConfig {
1414 pub auth_url : String ,
15- pub services : Vec < ServiceConfig > ,
15+ pub services : HashMap < String , ServiceConfig > ,
1616}
1717
1818pub fn load_config ( path : & str ) -> GatewayConfig {
You can’t perform that action at this time.
0 commit comments