Gorodov Maksim
11/27/2018, 7:53 AMGorodov Maksim
11/27/2018, 7:53 AMAccess to fetch at '...' from origin '<http://localhost:3000>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
The server is on graphql-yoga
, deployed to heroku (on local machine everything works great, no such issue). I tried to imprort cors
package and use it like that: server.express.use('/*', cors());
but it didn't help.Fran Dios
11/27/2018, 8:13 AMcors
options to your graphql-yoga https://github.com/prisma/graphql-yoga#startoptions-options-callback-options-options--void----null-promisevoidGorodov Maksim
11/27/2018, 9:13 AMserver.start(
{
cors: {
origin: [/\.netlify\.com.*/, /localhost:.*/],
},
},
({ port }) => console.log(`GraphQL server is running on the port ${port}`),
);