You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be interesting being able to programmatically access the detected routes, e.g the data used to generate this:
> node index.js
======== ROUTES ========
[Battery]
public get [/api/battery/]
[Consumption]
public get [/api/consumption/]
[Production]
public get [/api/production/]
public get [/api/production/solar]
public get [/api/production/wind]
========================
Example app listening at http://127.0.0.1:3000
It would allow automatic API discovery and -why not- the creation of a client SDK
The text was updated successfully, but these errors were encountered:
Hello @glimow, you're right it's interesting. I will implement it. It will allow creating custom reporter as well instead of the default one you just shown above.
Can describe the use case you'll be solving with this new enhancement?
Thanks @Alex-Levacher :)
My use case would be to create a custom client js SDK that would read route definition schema from a custom api route like api/config and would generate the resulting functions on the run. For example something with an API like
constsdk=SDK.init(" http://127.0.0.1:3000")//.... in an async functionconstsolarData=awaitsdk.production.solar.get()constwindData=awaitsdk.production.wind.get()// etc...
For some projects, I see two main advantages to this approach : it automatically wraps the REST api with more convenient javascript functions and it enforces some convention on the client side.
It would be interesting being able to programmatically access the detected routes, e.g the data used to generate this:
It would allow automatic API discovery and -why not- the creation of a client SDK
The text was updated successfully, but these errors were encountered: