Skip to content

Commit

Permalink
fix(nuxt3): init env
Browse files Browse the repository at this point in the history
  • Loading branch information
LarchLiu committed May 18, 2023
1 parent 6a92df7 commit 52ec5a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/nuxt3/server/api/telegram/adduser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { TG_CONFIG } from '~/server/utils/tgBot/env'

export default eventHandler(async (event) => {
const body = await readBody(event)
await initEnv()
const token = body.tgToken.trim()
const userId = body.userId.trim()
const test = /(\d+:[A-Za-z0-9_-]{35})/.test(token)
Expand Down
1 change: 1 addition & 0 deletions server/nuxt3/server/api/telegram/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { TG_CONFIG, TG_TOKENS, tgEnvDefault } from '~/server/utils/tgBot/env'
export default eventHandler(async (event) => {
const result: Record<string, any> = {}
const body = await readBody(event)
await initEnv()
const domain = `${getRequestProtocol(event)}://${getRequestHost(event)}`
const token = body.tgToken.trim()
const botName = body.botName
Expand Down

1 comment on commit 52ec5a8

@vercel
Copy link

@vercel vercel bot commented on 52ec5a8 May 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

star-nexus – ./

star-nexus-larchliu.vercel.app
star-nexus-git-main-larchliu.vercel.app
star-nexus.vercel.app

Please sign in to comment.