mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-08 17:32:27 +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).
|
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
|
||||||
Config app in `config/index.ts`.Please config:
|
Create a file named `.env.local` in the current directory and copy the contents from `.env.example`. Setting the following content:
|
||||||
- APP_ID
|
```
|
||||||
- API_KEY
|
# APP ID
|
||||||
|
NEXT_PUBLIC_APP_ID=
|
||||||
|
# APP API key
|
||||||
|
NEXT_PUBLIC_APP_KEY=
|
||||||
|
```
|
||||||
|
|
||||||
More config:
|
Config more in `config/index.ts` file:
|
||||||
```js
|
```js
|
||||||
export const APP_INFO: AppInfo = {
|
export const APP_INFO: AppInfo = {
|
||||||
"title": 'Chat APP',
|
title: 'Chat APP',
|
||||||
"description": '',
|
description: '',
|
||||||
"copyright": '',
|
copyright: '',
|
||||||
"privacy_policy": '',
|
privacy_policy: '',
|
||||||
"default_language": 'zh-Hans'
|
default_language: 'zh-Hans'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const isShowPrompt = true
|
export const isShowPrompt = true
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import type { AppInfo } from '@/types/app'
|
import type { AppInfo } from '@/types/app'
|
||||||
export const APP_ID = `${process.env.APP_ID}`
|
export const APP_ID = `${process.env.NEXT_PUBLIC_APP_ID}`
|
||||||
export const API_KEY = `${process.env.API_KEY}`
|
export const API_KEY = `${process.env.NEXT_PUBLIC_APP_KEY}`
|
||||||
export const API_URL = `${process.env.API_URL}`
|
export const API_URL = `${process.env.NEXT_PUBLIC_API_URL}`
|
||||||
export const APP_INFO: AppInfo = {
|
export const APP_INFO: AppInfo = {
|
||||||
title: 'Chat APP',
|
title: 'Chat APP',
|
||||||
description: '',
|
description: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user