Add basic docs page#36
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a hosted, interactive API reference (Scalar UI) backed by an OpenAPI 3.1 spec embedded into the binary. It also reworks the README to point users at the live docs and adds a lightweight docs subcommand for previewing the docs locally without needing InfluxDB or the API key store.
Changes:
- New
internal/docspackage that embedsopenapi.yamland serves it along with a Scalar-rendered HTML reference at/openapi.yamland/docs. main.goregisters the new doc routes on the main server and adds adocssubcommand that runs a minimal docs-only server.- README is rewritten to link to the hosted docs, document rate limits, the new
/healthzand/docsendpoints, and the docs update workflow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| README.md | Replaces inline endpoint docs with links to /docs, adds rate-limit and docs-preview sections, updates run command to go run .. |
| main.go | Wires /docs and /openapi.yaml into the server and adds a docs subcommand for a docs-only preview. |
| internal/docs/docs.go | New package: embeds the spec and serves the Scalar reference HTML. |
| internal/docs/openapi.yaml | New OpenAPI 3.1 spec describing all endpoints, schemas, auth, and error responses. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.