mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-04 11:13:59 +08:00
chore: 日志
This commit is contained in:
parent
dd92a26e6c
commit
6c54518e84
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.18.6",
|
"version": "2.18.7",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -38,6 +38,9 @@ export default function serve() {
|
|||||||
'SUB_STORE_FRONTEND_BACKEND_PATH should start with /',
|
'SUB_STORE_FRONTEND_BACKEND_PATH should start with /',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
$.info(
|
||||||
|
`[BACKEND PREFIX] ${host}:${port}${fe_be_path} -> ${host}:${port}`,
|
||||||
|
);
|
||||||
$app.use((req, res, next) => {
|
$app.use((req, res, next) => {
|
||||||
if (req.path.startsWith(fe_be_path)) {
|
if (req.path.startsWith(fe_be_path)) {
|
||||||
const newPath = req.url.replace(fe_be_path, '') || '/';
|
const newPath = req.url.replace(fe_be_path, '') || '/';
|
||||||
@ -220,7 +223,9 @@ export default function serve() {
|
|||||||
let be_download_rewrite = '';
|
let be_download_rewrite = '';
|
||||||
let be_api_rewrite = '';
|
let be_api_rewrite = '';
|
||||||
let be_share_rewrite = `${be_share}:type/:name`;
|
let be_share_rewrite = `${be_share}:type/:name`;
|
||||||
let prefix = eval('process.env.SUB_STORE_BACKEND_PREFIX') ? fe_be_path : '';
|
let prefix = eval('process.env.SUB_STORE_BACKEND_PREFIX')
|
||||||
|
? fe_be_path
|
||||||
|
: '';
|
||||||
if (fe_be_path) {
|
if (fe_be_path) {
|
||||||
if (!fe_be_path.startsWith('/')) {
|
if (!fe_be_path.startsWith('/')) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@ -290,10 +295,10 @@ export default function serve() {
|
|||||||
$.info(`[FRONTEND] ${fe_address}:${fe_port}`);
|
$.info(`[FRONTEND] ${fe_address}:${fe_port}`);
|
||||||
if (fe_be_path) {
|
if (fe_be_path) {
|
||||||
$.info(
|
$.info(
|
||||||
`[FRONTEND -> BACKEND] ${fe_address}:${fe_port}${be_api_rewrite} -> http://127.0.0.1:${port}${prefix}${be_api}`,
|
`[FRONTEND -> BACKEND] ${fe_address}:${fe_port}${be_api_rewrite} -> ${host}:${port}${prefix}${be_api}`,
|
||||||
);
|
);
|
||||||
$.info(
|
$.info(
|
||||||
`[FRONTEND -> BACKEND] ${fe_address}:${fe_port}${be_download_rewrite} -> http://127.0.0.1:${port}${prefix}${be_download}`,
|
`[FRONTEND -> BACKEND] ${fe_address}:${fe_port}${be_download_rewrite} -> ${host}:${port}${prefix}${be_download}`,
|
||||||
);
|
);
|
||||||
$.info(
|
$.info(
|
||||||
`[SHARE BACKEND] ${fe_address}:${fe_port}${be_share_rewrite}`,
|
`[SHARE BACKEND] ${fe_address}:${fe_port}${be_share_rewrite}`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user