Skip to content

Dynamic

Elijah Cobb edited this page Jan 18, 2020 · 3 revisions

On any endpoint group you can set a dynamic endpoint. This will let you support something like GET - /user/x where x is the id of a user. You can use the getEndpoint() method available on a HRequest instance to get the x part of the endpoint or if the id was 1234 use getUrl() to get "/user/1234".

To define a dynamic endpoint simply provide a HEndpointConstructorType or a HEndpointHandler to getDynamic(), postDynamic(), etc. For more information on defining endpoints view the endpoint page.

Pages

element-ts

Element is a group of developer tools I have built in TypeScript. Check them out at: element-ts.com.

About

Author: Elijah Cobb

NPM: @element-ts/hydrogen

Issue Reporting: Github Issues

Clone this wiki locally