mirror of
https://github.com/Permissionless-Software-Foundation/psf-bch-api-base.git
synced 2026-09-21 16:52:00 -07:00
Add AI-friendly API discovery endpoints
- Add /llms.txt for LLM/AI agent documentation - Add /openapi.json for OpenAPI spec - Update server.js to serve new endpoints - Document all API endpoints with examples and payment info These endpoints help AI agents discover and use the API correctly, including x402 payment requirements.
This commit is contained in:
@@ -252,6 +252,19 @@ class Server {
|
||||
res.sendFile(docsPath)
|
||||
})
|
||||
|
||||
// AI-friendly discovery endpoints
|
||||
app.get('/llms.txt', (req, res) => {
|
||||
const llmsPath = join(__dirname, '..', 'public', 'llms.txt')
|
||||
res.setHeader('Content-Type', 'text/plain')
|
||||
res.sendFile(llmsPath)
|
||||
})
|
||||
|
||||
app.get('/openapi.json', (req, res) => {
|
||||
const openapiPath = join(__dirname, '..', 'public', 'openapi.json')
|
||||
res.setHeader('Content-Type', 'application/json')
|
||||
res.sendFile(openapiPath)
|
||||
})
|
||||
|
||||
// MIDDLEWARE END
|
||||
|
||||
console.log(`Running server in environment: ${this.config.env}`)
|
||||
|
||||
Reference in New Issue
Block a user