Coder Social home page Coder Social logo

graycoreio / magento2-cors Goto Github PK

View Code? Open in Web Editor NEW
86.0 5.0 28.0 396 KB

A Magento 2 module that enables configurable CORS Headers on the GraphQL and REST APIs

Home Page: https://packagist.org/packages/graycore/magento2-cors

License: MIT License

PHP 100.00%
magento graphql cors magento2 magento2-module magento2-extension cors-headers cors-protocol php hacktoberfest

magento2-cors's Introduction

Magento 2 CORS

Packagist Downloads Packagist Version Packagist License Unit Test Integration Test Installation Test

Magento Version Support

Magento v2.3 Supported Magento v2.4 Supported

Ever try to work with the Magento GraphQL API or REST API from your browser and see the following?

Access to XMLHttpRequest at 'https://my.magento.app' from origin 'http://my.webapp.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

This package allows you to securely add the necessary CORS headers to the Magento 2 GraphQL or REST APIs with ease.

Purpose

When building a headless application for Magento, or working with a client that respects the CORS protocol, you will need CORS headers on your backend resource.

This package will add configurable CORS Resource headers to the Magento 2 GraphQL or REST APIs, allowing you to access the GraphQL or REST APIs from your browser.

Getting Started

This module is intended to be installed with composer. From the root of your Magento 2 project:

  1. Download the package
composer require graycore/magento2-cors
  1. Configure the package
  2. Enable the package
./bin/magento module:enable Graycore_Cors

Features

Helpful Links

Upgrading

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.