mirror of
https://github.com/supabase/supabase.git
synced 2026-05-06 08:56:46 -04:00
feat: add api-catalog to .well-known (#44880)
Adds a `/.well-known/api-catalog` to advertise our management API. Motivation is for agents, but this is generally part of [RFC 9727](https://www.rfc-editor.org/rfc/rfc9727). ## Testing Make an HTTP request to `/.well-known/api-catalog` and confirm it returns the JSON content with content type `application/linkset+json`: ```shell curl -i https://zone-www-dot-com-git-feat-agent-catalog-supabase.vercel.app/.well-known/api-catalog ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a public API catalog (linkset) exposing API metadata, OpenAPI endpoint, documentation and status links. * Added HTTP headers to advertise the API catalog from the site root and to serve the catalog with the correct content type. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -82,6 +82,22 @@ const nextConfig = {
|
||||
},
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
source: '/',
|
||||
headers: [
|
||||
{
|
||||
key: 'Link',
|
||||
value: '</.well-known/api-catalog>; rel="api-catalog"',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
source: '/.well-known/api-catalog',
|
||||
headers: [
|
||||
{ key: 'content-type', value: 'application/linkset+json' },
|
||||
{ key: 'access-control-allow-origin', value: '*' },
|
||||
],
|
||||
},
|
||||
{
|
||||
source: '/.well-known/vercel/flags',
|
||||
headers: [
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"linkset": [
|
||||
{
|
||||
"anchor": "https://api.supabase.com/v1",
|
||||
"service-desc": [
|
||||
{
|
||||
"href": "https://api.supabase.com/api/v1-json",
|
||||
"type": "application/openapi+json"
|
||||
}
|
||||
],
|
||||
"service-doc": [
|
||||
{
|
||||
"href": "https://api.supabase.com/api/v1"
|
||||
}
|
||||
],
|
||||
"status": [
|
||||
{
|
||||
"href": "https://status.supabase.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user