Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: CORS Middleware #12

Merged
merged 5 commits into from
Jun 22, 2024
Merged

Feat: CORS Middleware #12

merged 5 commits into from
Jun 22, 2024

Conversation

ItzNotABug
Copy link
Owner

No description provided.

@ItzNotABug ItzNotABug added the enhancement New feature or request label Jun 22, 2024
@ItzNotABug ItzNotABug self-assigned this Jun 22, 2024
@ItzNotABug
Copy link
Owner Author

Seems to work fine as registered on https://appexpressdev.appwrite.global.


fetch -

<html lang="en">
  <script>
    /// demoing the cors policy via `appexpress-cors`!
    const url = 'https://appexpressdev.appwrite.global/health';
    
    console.log(`fetching: ${url}`);
    
    fetch(url)
      .then((response) => {
        if (!response.ok) {
          throw new Error(`${response.statusText}`);
        }
        
        return response.json();
      }).then((data) => {
        console.log("data: ", JSON.stringify(data, null, 2));
      }).catch((error) => {
        console.error("error: ", error);
      });
  </script>
  
  <body>
    <div>Hello, world!</div>
  </body>
</html>

Result -

Screenshot 2024-06-22 at 1 36 29 PM

@ItzNotABug
Copy link
Owner Author

There's no README.md for this middleware!

@ItzNotABug
Copy link
Owner Author

LGTM!

@ItzNotABug ItzNotABug merged commit 56b72aa into master Jun 22, 2024
1 check passed
@ItzNotABug ItzNotABug deleted the feat-cors-middleware branch June 22, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant