Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-monitor
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
Administrator
web-monitor
Commits
16d39eb0
Commit
16d39eb0
authored
Apr 28, 2019
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix[Mock]: add error handling
parent
74da10ca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
mock-server.js
mock/mock-server.js
+12
-8
No files found.
mock/mock-server.js
View file @
16d39eb0
...
...
@@ -48,6 +48,7 @@ module.exports = app => {
ignoreInitial
:
true
}).
on
(
'all'
,
(
event
,
path
)
=>
{
if
(
event
===
'change'
||
event
===
'add'
)
{
try
{
// remove mock routes stack
app
.
_router
.
stack
.
splice
(
mockStartIndex
,
mockRoutesLength
)
...
...
@@ -59,6 +60,9 @@ module.exports = app => {
mockStartIndex
=
mockRoutes
.
mockStartIndex
console
.
log
(
chalk
.
magentaBright
(
`\n > Mock Server hot reload success! changed
${
path
}
`
))
}
catch
(
error
)
{
console
.
log
(
chalk
.
redBright
(
error
))
}
}
})
}
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