Skip to content

Commit cada09c

Browse files
committed
Open cors
1 parent 8bc8860 commit cada09c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: scripts/createPackage.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22
npm init -y
3-
npm install -s express body-parser easygraphql-mock express-graphql graphql
3+
npm install -s express body-parser easygraphql-mock express-graphql graphql cors

Diff for: templates/starterFileIndex.txt

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const bodyParser = require('body-parser')
77
const fs = require('fs')
88
const path = require('path')
99
const mocker = require('easygraphql-mock')
10+
const cors = require('cors')
1011

1112
const app = express()
1213

@@ -21,6 +22,8 @@ const mock = mocker(schemaCode)
2122

2223
const resolver = Object.assign({}, mock.Query, mock.Mutation)
2324

25+
app.use(cors())
26+
2427
app.use('/', (req, res) => {
2528
graphqlHTTP({
2629
schema,

0 commit comments

Comments
 (0)