Closed johannes4998 closed 3 years ago
Thank you for tackling this. Is there a reason to not list all app.post
and app.get
paths from https://github.com/SiegeEngineers/aoe2cm2/blob/master/src/DraftServer.ts?
No, im really new to this and dont know best practices. But when i look into DraftServer.ts, it seems like this handles the api calls. In my mind the change is just a static page with information about the api
No worries! I would say it makes sense to list all available api endpoints and methods in an api reference page.
Ideally, such a page would be generated automatically, but I researched that briefly and it seems to be nontrivial to turn these express routes into an api documentation automatically. Therefore I suggest to go with a manually written static page for now, as your draft implements it.
If you could update your pull request to include documentation for all 8 api calls, that would be lovely. If you are unsure about what a specific one is for, feel free to ask.
Ah, i didnt know there are more but i see them in DraftServer. Yes, i will include them too.
I added all api calls. But i would need help with the parameters for add draft/preset and alerts.
@johannes4998 what do you think about https://github.com/SiegeEngineers/aoe2cm2/commit/09e4099289d0a2f67c715ca92aa506566dc88223?
Added in 09e4099289d0a2f67c715ca92aa506566dc88223. Thanks for your work!
As discussed in SE Discord i try to add an API description to aoe2cm2. add a file API.tsx with the content add a route on index.tsx to /API and add a link in the footer