mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-08 09:12:29 +08:00
feat: support setting app api use env
This commit is contained in:
6
.env.example
Normal file
6
.env.example
Normal file
@ -0,0 +1,6 @@
|
||||
# APP ID
|
||||
NEXT_PUBLIC_APP_ID=
|
||||
# APP API key
|
||||
NEXT_PUBLIC_APP_KEY=
|
||||
# API url prefix
|
||||
NEXT_PUBLIC_API_URL=
|
||||
22
README.md
22
README.md
@ -2,18 +2,22 @@
|
||||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
||||
|
||||
## Config App
|
||||
Config app in `config/index.ts`.Please config:
|
||||
- APP_ID
|
||||
- API_KEY
|
||||
Create a file named `.env.local` in the current directory and copy the contents from `.env.example`. Setting the following content:
|
||||
```
|
||||
# APP ID
|
||||
NEXT_PUBLIC_APP_ID=
|
||||
# APP API key
|
||||
NEXT_PUBLIC_APP_KEY=
|
||||
```
|
||||
|
||||
More config:
|
||||
Config more in `config/index.ts` file:
|
||||
```js
|
||||
export const APP_INFO: AppInfo = {
|
||||
"title": 'Chat APP',
|
||||
"description": '',
|
||||
"copyright": '',
|
||||
"privacy_policy": '',
|
||||
"default_language": 'zh-Hans'
|
||||
title: 'Chat APP',
|
||||
description: '',
|
||||
copyright: '',
|
||||
privacy_policy: '',
|
||||
default_language: 'zh-Hans'
|
||||
}
|
||||
|
||||
export const isShowPrompt = true
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { AppInfo } from '@/types/app'
|
||||
export const APP_ID = `${process.env.APP_ID}`
|
||||
export const API_KEY = `${process.env.API_KEY}`
|
||||
export const API_URL = `${process.env.API_URL}`
|
||||
export const APP_ID = `${process.env.NEXT_PUBLIC_APP_ID}`
|
||||
export const API_KEY = `${process.env.NEXT_PUBLIC_APP_KEY}`
|
||||
export const API_URL = `${process.env.NEXT_PUBLIC_API_URL}`
|
||||
export const APP_INFO: AppInfo = {
|
||||
title: 'Chat APP',
|
||||
description: '',
|
||||
|
||||
Reference in New Issue
Block a user