Railway部署有办法塞主题吗 · zdz/ServerStatus-Rust · Discussion #37
Comment options
Railway 目前没看到自定义 route 的功能, 可以直接把你的主题替换 web 目录,然后重新编译构建部署
推荐的另一种方法是你可以在 vercel.app 部署前端主题,前后端分离部署,用 routes 指向后端,功能类似 nginx 反代,优点是隐藏后端和主题保持在自己的库中,主题随便修改而无需改动 server。目前 ssr.rs 也是使用这种方式。
新建一个库,然后在 vercel 导入部署(google vercel静态站点部署),工程目录结构
~$ tree .
.
├── README.md
├── css
│ ├── bootstrap-theme.min.css
│ ├── bootstrap-theme.min.css.map
│ ├── bootstrap.min.css
│ ├── bootstrap.min.css.map
│ ├── dark.css
│ └── light.css
├── favicon.ico
├── google89dd963c5b122b1b.html
├── img
│ ├── dark.png
│ └── light.png
├── index.html
├── js
│ ├── bootstrap.min.js
│ ├── html5shiv.js
│ ├── jquery.min.js
│ ├── respond.min.js
│ └── serverstatus.js
├── netlify.toml
└── vercel.json
在 vercel.json 来指定其它路由,你的 railway 或其它方式部署的 stat_server
{
"routes": [
{
"src": "/report",
"dest": "http://tz.xxx.com:8080/report"
},
{
"src": "/json/stats.json",
"dest": "http://tz.xxx.com:8080/json/stats.json"
},
{
"src": "/detail",
"dest": "http://tz.xxx.com:8080/detail"
},
{
"src": "/map",
"dest": "http://tz.xxx.com:8080/map"
},
{
"src": "/i",
"dest": "http://tz.xxx.com:8080/i"
}
]
}
You must be logged in to vote
5 replies