File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -18,4 +18,16 @@ export const handlers = [
1818 // - /api/v1/data/:object/:id (GET, PUT, DELETE)
1919 // - /api/v1/metadata/*
2020 // - /api/bootstrap
21+
22+ // Handle /api/v1/index.json for ObjectStackClient.connect()
23+ http . get ( '/api/v1/index.json' , async ( ) => {
24+ return HttpResponse . json ( {
25+ version : '1.0' ,
26+ objects : [ 'contact' , 'opportunity' , 'account' ] ,
27+ endpoints : {
28+ data : '/api/v1/data' ,
29+ metadata : '/api/v1/metadata'
30+ }
31+ } ) ;
32+ } ) ,
2133] ;
Original file line number Diff line number Diff line change @@ -45,6 +45,17 @@ export async function startMockServer() {
4545 baseUrl : '/api/v1' ,
4646 logRequests : true ,
4747 customHandlers : [
48+ // Handle /api/v1/index.json for ObjectStackClient.connect()
49+ http . get ( '/api/v1/index.json' , async ( ) => {
50+ return HttpResponse . json ( {
51+ version : '1.0' ,
52+ objects : [ 'contact' , 'opportunity' , 'account' ] ,
53+ endpoints : {
54+ data : '/api/v1/data' ,
55+ metadata : '/api/v1/metadata'
56+ }
57+ } ) ;
58+ } ) ,
4859 // Explicitly handle all metadata requests to prevent pass-through
4960 http . get ( '/api/v1/metadata/*' , async ( ) => {
5061 return HttpResponse . json ( { } ) ;
You can’t perform that action at this time.
0 commit comments