Skip to content

Commit

Permalink
exclude region
Browse files Browse the repository at this point in the history
  • Loading branch information
babaohuang committed Dec 15, 2023
1 parent 80e90c4 commit 0e2b99e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/pages/api/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import { startChatAndSendMessageStream } from '@/utils/openAI'
import { verifySignature } from '@/utils/auth'
import type { APIRoute } from 'astro'

export const config = {
runtime: 'edge', // this is a pre-requisite
// execute this function on iad1 or hnd1, based on the connecting client location
regions: ['arn1', 'bom1', 'cdg1', 'cle1', 'cpt1', 'dub1', 'fra1', 'gru1', 'hnd1', 'iad1', 'icn1', 'kix1', 'lhr1', 'pdx1', 'sfo1', 'sin1', 'syd1'],
}

const sitePassword = import.meta.env.SITE_PASSWORD || ''
const passList = sitePassword.split(',') || []

Expand Down
3 changes: 1 addition & 2 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"buildCommand": "OUTPUT=vercel astro build",
"regions": ["hnd1"]
"buildCommand": "OUTPUT=vercel astro build"
}

0 comments on commit 0e2b99e

Please sign in to comment.