Skip to content

Commit

Permalink
Add missing example server dependencies and allow cross-origin reques…
Browse files Browse the repository at this point in the history
…ts when the example app runs on web. (#1775)

Co-authored-by: Sebastian <sebastian@barfoos.com>
  • Loading branch information
ignatz and ignatz committed May 21, 2024
1 parent 627d38f commit b12f899
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions example/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@babel/cli": "^7.12.1",
"@babel/core": "^7.9.6",
"@babel/runtime": "^7.9.6",
"@types/body-parser": "^1.19.5",
"@types/dotenv": "^8.2.0",
"@types/express": "^4.17.2",
"@types/jest": "^26.0.14",
Expand All @@ -52,6 +53,7 @@
},
"dependencies": {
"@types/cors": "^2.8.12",
"body-parser": "^1.20.2",
"eslint-plugin-jest": "^24.1.0",
"jest": "^26.5.3",
"ts-jest": "^26.4.1"
Expand Down
3 changes: 3 additions & 0 deletions example/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ env.config({ path: './.env' });

import bodyParser from 'body-parser';
import express from 'express';
import cors from 'cors';

import Stripe from 'stripe';
import { generateResponse } from './utils';
Expand All @@ -16,6 +17,8 @@ const stripeWebhookSecret = process.env.STRIPE_WEBHOOK_SECRET || '';

const app = express();

app.use(cors());

app.use(
(
req: express.Request,
Expand Down

0 comments on commit b12f899

Please sign in to comment.