Skip to content
Snippets Groups Projects
Commit 40447766 authored by Wilson JALLET's avatar Wilson JALLET :money_with_wings:
Browse files

Updated import of connexion config

Added config options for cors
parent cca1dbaa
No related branches found
No related tags found
No related merge requests found
...@@ -78,10 +78,19 @@ server.use('/assets',express.static(path.resolve('./','assets'))); ...@@ -78,10 +78,19 @@ server.use('/assets',express.static(path.resolve('./','assets')));
// Morgan is middleware for logging requests // Morgan is middleware for logging requests
server.use(morgan('dev')); server.use(morgan('dev'));
const defaultUser = require('../ldap_connexion_config.json'); const defaultUser = require('./../ldap_connexion_config.json');
/**
* @desc Options de configuration pour le _middleware_ `cors`.
*/
const corsOptions = {
origin: 'http://localhost:8888',
credentials: true // <-- REQUIRED backend setting
};
server.use(cors(corsOptions));
// Charge le middleware express pour GraphQL // Charge le middleware express pour GraphQL
server.use('/graphql', bodyParser.json(), cors(), server.use('/graphql', bodyParser.json(),
graphqlExpress(req => { graphqlExpress(req => {
let uid; let uid;
let password; let password;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment