chore: Adjust cors options

This commit is contained in:
Faruk AYDIN
2021-10-04 21:40:17 +02:00
committed by Ali BARIN
parent fc9bcc5c14
commit c0f022a1b0
6 changed files with 40 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
import appConfig from './config/app'
import createError from 'http-errors';
import express, { Request, Response, NextFunction } from 'express';
import cors from 'cors';
import corsOptions from './config/cors-options';
import { graphqlHTTP } from 'express-graphql';
import logger from './helpers/logger';
import morgan from './helpers/morgan';
@@ -15,6 +17,8 @@ app.use(morgan);
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cors(corsOptions))
app.use(
'/graphql',
graphqlHTTP({