No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
frontend
server
.gitignore
README.md

README.md

graphql-cors-example

This repository demonstrates how to configure CORS for an express.js-based GraphQL server. (This example uses apollo-server, but usage with express-graphql is equivalent.)

Read the full article here.

Get started

Clone the repository:

git clone https://github.com/nikolasburk/graphql-cors-example.git

Start the server:

cd server
yarn install
yarn start

Start the frontend:

cd ../frontend
yarn install
yarn start

Test the app:

To test the app, simply open http://localhost:3000 in your browser. Note that you can provoke a CORS error by commenting out app.use(cors()) as described in the article.