-
Notifications
You must be signed in to change notification settings - Fork 11
feat(API): add text content API #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
351905f to
48e0d85
Compare
dlabaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments otherwise looks good.
src/pages/text/[version].ts
Outdated
| if (!version) { | ||
| return new Response( | ||
| JSON.stringify({ error: 'Version parameter is required' }), | ||
| { status: 400, headers: { 'Content-Type': 'application/json' } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should create a helper function to generate the HTTP headers. Content-Type should also specify character encoding. Would set this to application/json; charset=utf-8
| return new Response( | ||
| JSON.stringify({ error: 'Version parameter is required' }), | ||
| { status: 400, headers: { 'Content-Type': 'application/json' } }, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the header we should also include the Content-Length, Date, and disable caching by setting Cache-Control to no-cache. I'm not sure about CORS, it's something we can probably skip right now while in development but may need to revisit later.
src/pages/text/openapi.json.ts
Outdated
| }, | ||
| servers: [ | ||
| { | ||
| url: '/text', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change this to /api
|
🎉 This PR is included in version 1.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This reverts commit 3798460.
Revert "feat(API): add text content API (#174)"
Closes #151
Assisted by Claude Code running claude-3-5-haiku and claude-sonnet