janus
janus copied to clipboard
Multiple endpoint definitions on a single file wrong behaves
Hey, I was trying to add multiple endpoints in a single file.
Here is my config:
[
{
"name": "root",
"active": true,
"proxy": {
"listen_path": "/v1/",
"upstreams": {
"balancing": "roundrobin",
"targets": [
{ "target": "http://192.168.0.82:3000" }
]
},
"methods": ["GET"]
}
},
{
"name": "get-user-promo-id",
"active": true,
"proxy": {
"listen_path": "/v1/promo/{id}",
"upstreams": {
"balancing": "roundrobin",
"targets": [
{ "target": "http://192.168.0.82:3000/userpromo/{id}" }
]
},
"methods": ["GET"]
}
},
{
"name": "get-company-promo",
"active": true,
"proxy": {
"listen_path": "/v1/promo/",
"upstreams": {
"balancing": "roundrobin",
"targets": [
{ "target": "http://192.168.0.82:3000/promo" }
]
},
"methods": ["GET"]
}
}
]
I found that it works only for the last defined endpoint, in this case, "get-company-promo". First two don't work. I tried to change the arrangement of them. But it always works for the last one only.
Janus version: 3.5.0 Running this from a Docker container on a Mac.
@aniskhan001 what is the persistence storage implementation you are using?
I'm using a compose file. These are the volumes I'm using for janus service.
volumes:
- ./janus.toml:/etc/janus/janus.toml
- ./apis:/etc/janus/apis
can confirm this with the latest rc
I am also getting the same issue. is there any fix for this ?
never mind. in my case i used the same name for both endpoints. so please make sure you dont use duplicate names when you define endpoints