Skip to content

feat: add browser example and sandbox CORS support#17

Merged
AryanSharma48 merged 4 commits into
AryanSharma48:mainfrom
aaishmeen:feature/browser-example
Jun 18, 2026
Merged

feat: add browser example and sandbox CORS support#17
AryanSharma48 merged 4 commits into
AryanSharma48:mainfrom
aaishmeen:feature/browser-example

Conversation

@aaishmeen

Copy link
Copy Markdown
Contributor

Closes #2

Summary

Adds a browser-based example under examples/browser demonstrating SmoothAPI's core resilience features:

  • Retry behavior using /unstable-data
  • Circuit breaker behavior using /always-fail
  • Fallback handling with createResilientFetch

Also adds CORS support to the sandbox server so browser-based examples can communicate with the local sandbox during development.

Changes

  • Added a new browser example under examples/browser
  • Set up a lightweight Vite + TypeScript environment
  • Added a Retry Demo using /unstable-data
  • Added a Circuit Breaker Demo using /always-fail
  • Added browser example documentation and setup instructions
  • Added CORS headers to the sandbox server to enable browser-based requests

Testing

  • Started the local sandbox server
  • Ran the browser example using Vite
  • Verified retry behavior against /unstable-data
  • Verified circuit breaker behavior against /always-fail
  • Confirmed fallback responses were returned when expected
  • Confirmed browser requests worked correctly after enabling CORS support

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

@aaishmeen is attempting to deploy a commit to the aryansharma48's projects Team on Vercel.

A member of the Team first needs to authorize it.

@AryanSharma48
AryanSharma48 requested a review from Copilot June 18, 2026 15:10

This comment was marked as spam.

@AryanSharma48

Copy link
Copy Markdown
Owner

Seem good 👍

@AryanSharma48
AryanSharma48 merged commit 2660219 into AryanSharma48:main Jun 18, 2026
4 of 5 checks passed
@aaishmeen
aaishmeen deleted the feature/browser-example branch June 18, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Browser Example

3 participants