Skip to content

Commit

Permalink
Merge pull request #9 from ebisLab/cors
Browse files Browse the repository at this point in the history
CORS set up
  • Loading branch information
ebisLab authored Mar 7, 2021
2 parents a05e26e + 69e96ba commit 44249d2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"isomorphic-unfetch": "^3.1.0",
"lodash": "^4.17.20",
"next": "10.0.7",
"nextjs-cors": "^1.0.3",
"nextjs-redirect": "^5.0.0",
"node-fetch": "^2.6.1",
"nodemon": "^2.0.7",
Expand Down
5 changes: 4 additions & 1 deletion src/components/ApolloClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ export const afterware = new ApolloLink( ( operation, forward ) => {
const client = new ApolloClient({
ssrMode: typeof window === 'undefined',
link: middleware.concat( afterware.concat( createHttpLink({
uri: `${process.env.NEXT_PUBLIC_WORDPRESS_URL}/graphql`
uri: `${process.env.NEXT_PUBLIC_WORDPRESS_URL}/graphql`,
optionsSuccessStatus: 200,
credentials:true

}) ) ),
cache: new InMemoryCache(),
});
Expand Down

1 comment on commit 44249d2

@vercel
Copy link

@vercel vercel bot commented on 44249d2 Mar 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.