msw-global-api-mocks.ts 761 B

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