|
|
@ -36,7 +36,7 @@ import workshopResolvers from './resolvers/workshopResolvers';
|
|
|
|
import { ActionLog } from './model/ActionLog';
|
|
|
|
import { ActionLog } from './model/ActionLog';
|
|
|
|
import actionLogResolvers from './resolvers/actionLogResolvers';
|
|
|
|
import actionLogResolvers from './resolvers/actionLogResolvers';
|
|
|
|
import { ActionLogAPI } from './datasources/db/actionLogAPI';
|
|
|
|
import { ActionLogAPI } from './datasources/db/actionLogAPI';
|
|
|
|
|
|
|
|
const cors = require('express-cors');
|
|
|
|
require('dotenv').config();
|
|
|
|
require('dotenv').config();
|
|
|
|
|
|
|
|
|
|
|
|
const connOptions: ConnectionOptions = {
|
|
|
|
const connOptions: ConnectionOptions = {
|
|
|
@ -135,7 +135,11 @@ const app = express();
|
|
|
|
app.post('/graphql', authenticate);
|
|
|
|
app.post('/graphql', authenticate);
|
|
|
|
app.get(/\/graphql?&.*query=/, authenticate);
|
|
|
|
app.get(/\/graphql?&.*query=/, authenticate);
|
|
|
|
server.applyMiddleware({ app });
|
|
|
|
server.applyMiddleware({ app });
|
|
|
|
|
|
|
|
app.use(cors({
|
|
|
|
|
|
|
|
allowedOrigins: [
|
|
|
|
|
|
|
|
'*'
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}));
|
|
|
|
app.listen(4000, async () => {
|
|
|
|
app.listen(4000, async () => {
|
|
|
|
await userAPI.createDefinedPermissions().catch(
|
|
|
|
await userAPI.createDefinedPermissions().catch(
|
|
|
|
err => console.log(err));
|
|
|
|
err => console.log(err));
|
|
|
|