msw-global-api-mocks.ts27 lines · main
| 1 | import { http, HttpResponse } from 'msw' |
| 2 | |
| 3 | import { API_URL } from '@/lib/constants' |
| 4 | |
| 5 | export const GlobalAPIMocks = [ |
| 6 | http.get(`${API_URL}/msw/test`, () => { |
| 7 | return HttpResponse.json({ message: 'Hello from MSW!' }) |
| 8 | }), |
| 9 | http.get(`${API_URL}/platform/projects/default/databases`, () => { |
| 10 | return HttpResponse.json([ |
| 11 | { |
| 12 | cloud_provider: 'AWS', |
| 13 | connectionString: '123', |
| 14 | connection_string_read_only: '123', |
| 15 | db_host: '123', |
| 16 | db_name: 'postgres', |
| 17 | db_port: 5432, |
| 18 | identifier: 'default', |
| 19 | inserted_at: '2025-02-16T22:24:42.115195', |
| 20 | region: 'us-east-1', |
| 21 | restUrl: 'https://default.supabase.co', |
| 22 | size: 't4g.nano', |
| 23 | status: 'ACTIVE_HEALTHY', |
| 24 | }, |
| 25 | ]) |
| 26 | }), |
| 27 | ] |