Skip to content
Merged

Next #16

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
],
"dependencies": {
"@microlink/mql": "~0.10.28",
"next": "~12.3.0",
"next": "~13.0.0",
"react": "~18.2.0",
"react-dom": "~18.2.0"
},
Expand Down
5 changes: 3 additions & 2 deletions pages/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ const NODE_ENV = process.env.NODE_ENV
const API_ENDPOINT = process.env.API_ENDPOINT || 'https://pro.microlink.io'
const API_KEY = process.env.API_KEY

const origins = process.env.ORIGINS.split(',').map(n => n.trim())
const origins = process.env.ORIGINS?.split(',').map(n => n.trim())

const isProduction = NODE_ENV === 'production'

const isAllowedDomain =
isProduction && origins.length > 0
isProduction && Array.isArray(origins)
? origin => origins.includes(origin)
: () => true

Expand Down