Previously the name provieded to api.get('/the-name') had to be unique.
Internally we used that name for a few internal maps that assumed they would always be unique.
However, we want to support the ability for createApi to support scenariors where you have the same name HTTP endpoint defined multiple times. Why would someone want that? Because we have special sagas that can be used to provide additional functionality to our endpoints -- like polling -- we want to ensure they can use them without colliding with more basic endpoints.
The first part is the string used to generate the url with our urlParser middleware. The remaining parts are used for making the name unique and are otherwise not used.
Although other middleware could be creative with using the array of strings.
Previously the name provieded to
api.get('/the-name')
had to be unique.Internally we used that name for a few internal maps that assumed they would always be unique.
However, we want to support the ability for
createApi
to support scenariors where you have the same name HTTP endpoint defined multiple times. Why would someone want that? Because we have special sagas that can be used to provide additional functionality to our endpoints -- like polling -- we want to ensure they can use them without colliding with more basic endpoints.Here we have a case where we want to duplicate the name because it relates to the API endpoint we want to hit.
To fix this we now support the ability to provide an array for the name of the endpoint.
The first part is the string used to generate the url with our
urlParser
middleware. The remaining parts are used for making the name unique and are otherwise not used.Although other middleware could be creative with using the array of strings.