Skip to content

Commit

Permalink
Fix CORS error (3)
Browse files Browse the repository at this point in the history
  • Loading branch information
loris-catalano committed Nov 16, 2024
1 parent a827df9 commit 9ba5b8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions qlkube/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"apollo-link-http": "^1.5.17",
"body-parser": "^1.20.2",
"compression": "^1.7.4",
"cors": "^2.8.5",
"dotenv": "^9.0.2",
"express": "^4.19.2",
"got": "^12.6.1",
Expand Down
2 changes: 1 addition & 1 deletion qlkube/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ async function main() {
const app = express();
app.use(compression());
app.use(bodyParser.json());
app.use(cors());

app.get('/schema', (req, res) => {
res.setHeader('content-type', 'text/plain');
Expand Down Expand Up @@ -160,7 +161,6 @@ async function main() {

app.use(
'/',
cors<cors.CorsRequest>({ origin: ['*'] }),
expressMiddleware(server, {
context: async ({ req }) => {
const token = getBearerToken(req.headers);
Expand Down

0 comments on commit 9ba5b8e

Please sign in to comment.