Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
acdb096d
Commit
acdb096d
authored
4 years ago
by
张烨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update proxy match regexp
parent
5d43ab8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
addDevMiddlewares.js
server/middlewares/addDevMiddlewares.js
+2
-2
No files found.
server/middlewares/addDevMiddlewares.js
View file @
acdb096d
...
...
@@ -64,13 +64,13 @@ module.exports = function addDevMiddlewares(app, webpackConfig) {
const
proxy2
=
process
.
env
.
PROXY2
;
if
(
proxy2
)
{
const
reg
=
/
(
\w
+
)\s
+:
\s
+
([\w
:.
/]
+
)
/
;
const
reg
=
/
(
[/\w]
+
)\s
*:
\s
*
([\w
:.
/]
*
)
/
;
const
match
=
proxy2
.
match
(
reg
);
const
[,
pre
,
host
]
=
match
;
logger
.
info
(
`using proxy2 at:
${
host
}
`
);
logger
.
info
(
`proxy2 prefix:
${
pre
}
`
);
app
.
use
(
`
/
${
pre
}
`
,
`
${
pre
.
indexOf
(
0
)
===
'/'
?
pre
:
`/
${
pre
}
`
}
`
,
createProxyMiddleware
({
target
:
host
,
changeOrigin
:
true
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment