Skip to content

Commit a9794cd

Browse files
committed
Add packages
1 parent c651abd commit a9794cd

File tree

5 files changed

+358
-189
lines changed

5 files changed

+358
-189
lines changed

backend/api/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"colors": "1.4.0",
4545
"cors": "2.8.5",
4646
"dayjs": "1.11.4",
47-
"express": "4.18.1",
47+
"express": "5.0.0",
4848
"firebase-admin": "13.5.0",
4949
"gcp-metadata": "6.1.0",
5050
"jsonwebtoken": "9.0.0",
@@ -57,10 +57,11 @@
5757
"swagger-ui-express": "5.0.1",
5858
"tsconfig-paths": "4.2.0",
5959
"twitter-api-v2": "1.15.0",
60-
"ws": "8.17.0",
60+
"ws": "8.17.1",
6161
"react": "18.2.0",
6262
"react-dom": "18.2.0",
63-
"zod": "3.21.4"
63+
"openapi-types": "12.1.3",
64+
"zod": "3.22.3"
6465
},
6566
"devDependencies": {
6667
"@types/cors": "2.8.17",

backend/api/src/app.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {API, type APIPath} from 'common/api/schema'
22
import {APIError, pathWithPrefix} from 'common/api/utils'
3-
import cors from 'cors'
3+
import cors, {CorsOptions} from 'cors'
44
import * as crypto from 'crypto'
55
import express, {type ErrorRequestHandler, type RequestHandler} from 'express'
66
import {hrtime} from 'node:process'
@@ -60,6 +60,12 @@ import {createVote} from "api/create-vote";
6060
import {vote} from "api/vote";
6161
import {contact} from "api/contact";
6262

63+
// const corsOptions: CorsOptions = {
64+
// origin: ['*'], // Only allow requests from this domain
65+
// methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
66+
// allowedHeaders: ['Content-Type', 'Authorization'],
67+
// credentials: true, // if you use cookies or auth headers
68+
// };
6369
const allowCorsUnrestricted: RequestHandler = cors({})
6470

6571
function cacheController(policy?: string): RequestHandler {
@@ -123,7 +129,9 @@ const rootPath = pathWithPrefix("/")
123129
app.get(rootPath, swaggerUi.setup(swaggerDocument))
124130
app.use(rootPath, swaggerUi.serve)
125131

126-
app.options('*', allowCorsUnrestricted)
132+
// Triggers Missing parameter name at index 3: *; visit https://git.new/pathToRegexpError for info
133+
// May not be necessary
134+
// app.options('*', allowCorsUnrestricted)
127135

128136
const handlers: { [k in APIPath]: APIHandler<k> } = {
129137
health: health,

common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"dayjs": "1.11.4",
2323
"lodash": "4.17.21",
2424
"string-similarity": "4.0.4",
25-
"zod": "3.21.4"
25+
"zod": "3.22.3"
2626
},
2727
"devDependencies": {
2828
"@types/jest": "29.2.4",

web/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@
4646
"firebase": "11.1.0",
4747
"link-preview-js": "3.0.4",
4848
"lodash": "4.17.21",
49-
"nanoid": "^3.3.4",
49+
"nanoid": "5.0.9",
5050
"next": "14.1.0",
51-
"openapi-types": "12.1.3",
5251
"posthog-js": "1.234.1",
5352
"punycode": "2.3.1",
5453
"react-expanding-textarea": "2.3.6",

0 commit comments

Comments
 (0)