File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,9 @@ const getMod = file => {
29
29
30
30
module . exports = ( file , flags ) => {
31
31
const server = serve ( getMod ( file ) )
32
+
32
33
let port = flags . port
34
+ let host = flags . host
33
35
34
36
detect ( port ) . then ( open => {
35
37
let inUse = open !== port
@@ -43,7 +45,11 @@ module.exports = (file, flags) => {
43
45
}
44
46
}
45
47
46
- server . listen ( port , flags . host , async err => {
48
+ if ( host === '0.0.0.0' ) {
49
+ host = null
50
+ }
51
+
52
+ server . listen ( port , host , async err => {
47
53
if ( err ) {
48
54
console . error ( 'micro:' , err . stack )
49
55
process . exit ( 1 )
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const copyToClipboard = async text => {
12
12
}
13
13
}
14
14
15
- module . exports = async ( server , current , inUse ) => {
15
+ module . exports = async ( server , inUse ) => {
16
16
const details = server . address ( )
17
17
const ipAddress = ip . address ( )
18
18
const url = `http://${ ipAddress } :${ details . port } `
You can’t perform that action at this time.
0 commit comments