eduardoboucas / staticman.net

💪 Staticman website
https://staticman.net
4 stars 11 forks source link

[BUG] Where's '/api-docs' route? #14

Open VincentTam opened 3 years ago

VincentTam commented 3 years ago

Description

In step 4 of the quick start guide https://github.com/eduardoboucas/staticman.net/blob/d1174fed6813a79f5ab002e01b3a77cfa47cea60/docs/getting-started.md#step-4-hook-up-your-forms, it's said that the API are documented at that route.

You can view full API docs at {STATICMAN_BASE_URL}/api-docs including example values.

However, I tried to GET https://myinstance.herokuapp.com/v3/api-docs (with myinstance replaced with my instance) and got a 404 error.

Screenshot from 2021-02-12 14-33-29

I'm not disclosing info about my browser because this not a client-side problem. Here's a related Heroku log entry. Observe that the path="/api-docs" and status=404. (I hide the host and fwd here.)

2021-02-12T13:12:23.466402+00:00 heroku[router]: at=info method=GET path="/api-docs"
host=myinstance.herokuapp.com request_id=cc245296-f40c-46d3-b2d1-9949c601fa88 fwd="xxx.xxx.xxx.xxx"
dyno=web.1 connect=0ms service=30ms status=404 bytes=501 protocol=http

Analysis

Searching the code with "api-docs" in the official repo gives nothing: https://github.com/eduardoboucas/staticman/search?q=api-docs&type=code.

alexwaibel commented 3 years ago

We need to promote the dev branch of staticman to master. In dev I introduced some autogenerated swagger docs for the api. See the annotations here on each of the routes.

https://github.com/eduardoboucas/staticman/blob/dev/source/server.js

alexwaibel commented 3 years ago

Made a PR here to address this.