Hi Team.
I found that there’s an endpoint designer function that i can add more than 1 endpoints under single api.
for example, when api A url is /test, i can add more than 1 endpoints like /test/foo, test/bar under api A
and these configurations are stored together in 1 API definition
...
"custom_middleware": {
"pre": [],
"post": [
{
"name": "TestPostRequest",
"path": "/plugin-source/test11_v4.3.1_linux_amd64.so",
"require_session": false,
"raw_body_only": false
}
],
"post_key_auth": [],
"auth_check": {
"name": "",
"path": "",
"require_session": false,
"raw_body_only": false
},
"response": [
{
"name": "TestResponse",
"path": "/plugin-source/test11_v4.3.1_linux_amd64.so",
"require_session": false,
"raw_body_only": false
}
],
"driver": "goplugin",
"id_extractor": {
"extract_from": "",
"extract_with": "",
"extractor_config": {}
}
},
...
"extended_paths": {
"url_rewrites": [
{
"path": "/bye",
"method": "GET",
"match_pattern": "bye",
"rewrite_to": "http://host.docker.internal:9090/bye",
"triggers": []
},
{
"path": "/hello",
"method": "GET",
"match_pattern": "/hello",
"rewrite_to": "http://host.docker.internal:9090/hello",
"triggers": []
}
],
"go_plugin": [
{
"method": "GET",
"path": "/test",
"plugin_path": "",
"func_name": ""
}
]
}
}
...
so i have some question about this.
Q1.
Regarding documents I can define body transform per endpoint, but it seems not for custom plugins
So, can i control to apply custom plugin per endpoint?
When I set up custom plugins, I couldn’t decide whether to apply it to each endpoint, and it was applied to the whole.
https://tyk.io/docs/advanced-configuration/transform-traffic/endpoint-designer/
Q2.
How do I apply the go plugin function in API Definition and what is the difference from custom plugin? The hook point cannot be specified in the go plugin configuration, so it is not known when it is performed.
is there any detail about the go plugin, please let me know
https://tyk.io/docs/plugins/supported-languages/golang/#golang-virtual-endpoints
Q3.
When should I use endpoint handler? If there are 3 endpoints in one API, is it better to register five endpoints with one API? Or should I register an independent API for each endpoint?
Is there any best practice to use endpoint handler?
Thanks for your support