Skip to content

Commit

Permalink
feat: nextjs add base path
Browse files Browse the repository at this point in the history
  • Loading branch information
cooderl committed Feb 29, 2024
1 parent d9a6193 commit 299bb8a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ services:
environment:
# 同 SERVER_ORIGIN_URL
- NEXT_PUBLIC_SERVER_ORIGIN_URL=http://localhost:4000
# 路由前缀,在配置nginx路径时可以使用
- BASE_PATH=''

networks:
wewe-rss:
Expand Down Expand Up @@ -104,6 +106,7 @@ docker run -d \
-p 4000:4000 \
-e DATABASE_URL='mysql://root:123456@db:3306/wewe-rss?schema=public&connect_timeout=30&pool_timeout=30&socket_timeout=30' \
-e AUTH_CODE=123567 \
-e FEED_MODE=fulltext \
-e MAX_REQUEST_PER_MINUTE=60 \
-e SERVER_ORIGIN_URL="http://localhost:4000" \
cooderl/wewe-rss-server:latest
Expand Down Expand Up @@ -153,6 +156,8 @@ docker run -d \
- `NEXT_PUBLIC_SERVER_ORIGIN_URL` (必填项)服务端接口地址,一般跟 `SERVER_ORIGIN_URL` 一致即可。


- `BASE_PATH` 路由前缀,在配置nginx路径时可以使用
-
## 本地开发


Expand Down
1 change: 1 addition & 0 deletions apps/web/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
basePath: process.env.BASE_PATH || '',
async redirects() {
return [
{
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ services:
environment:
# 同 SERVER_ORIGIN_URL
- NEXT_PUBLIC_SERVER_ORIGIN_URL=http://localhost:4000
# 路由前缀,在配置nginx路由时可以使用
- BASE_PATH=''

networks:
wewe-rss:
Expand Down

0 comments on commit 299bb8a

Please sign in to comment.