mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
fix(web): configure development proxy and update port documentation (#5)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
- `QDRANT_URL` - Qdrant 连接字符串(默认:http://localhost:6333)
|
||||
- `REDIS_URL` - Redis 连接字符串(默认:redis://localhost:6379)
|
||||
- `API_PORT` - API 服务端口(默认:7002)
|
||||
- `API_PORT` - API 服务端口(默认:8080)
|
||||
|
||||
## 模型配置
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ pnpm run db:push
|
||||
pnpm run api:dev
|
||||
```
|
||||
|
||||
API 服务将在 `http://localhost:7002` 启动。
|
||||
API 服务将在 `http://localhost:8080` 启动。
|
||||
|
||||
## 下一步
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useRouter } from 'vue-router'
|
||||
const router=useRouter()
|
||||
export default (function () {
|
||||
const axiosInstance = axios.create({
|
||||
baseURL:'http://localhost:7002/'
|
||||
baseURL: '/api'
|
||||
})
|
||||
|
||||
axiosInstance.interceptors.response.use((response) => {
|
||||
|
||||
@@ -16,10 +16,24 @@ export default defineConfig({
|
||||
server: {
|
||||
port,
|
||||
host: '0.0.0.0',
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, "")
|
||||
}
|
||||
},
|
||||
},
|
||||
preview: {
|
||||
port,
|
||||
host: '0.0.0.0',
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, "")
|
||||
}
|
||||
},
|
||||
allowedHosts: true,
|
||||
},
|
||||
resolve: {
|
||||
|
||||
Reference in New Issue
Block a user