piclist 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/picgo-server +3 -10
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/package.json +1 -1
package/bin/picgo-server
CHANGED
|
@@ -192,14 +192,9 @@ class Server {
|
|
|
192
192
|
const result = this.checkIfConfigIsValid(config)
|
|
193
193
|
if (result) {
|
|
194
194
|
this.config = config
|
|
195
|
-
if (this.config.host === '127.0.0.1') {
|
|
196
|
-
this.config.host = '0.0.0.0'
|
|
197
|
-
}
|
|
198
195
|
} else {
|
|
199
196
|
config = {
|
|
200
|
-
port: 36677
|
|
201
|
-
host: '0.0.0.0',
|
|
202
|
-
enable: true
|
|
197
|
+
port: 36677
|
|
203
198
|
}
|
|
204
199
|
this.config = config
|
|
205
200
|
picgo.saveConfig({
|
|
@@ -298,7 +293,7 @@ class Server {
|
|
|
298
293
|
if (typeof port === 'string') {
|
|
299
294
|
port = parseInt(port, 10)
|
|
300
295
|
}
|
|
301
|
-
this.httpServer.listen(port,
|
|
296
|
+
this.httpServer.listen(port, '0.0.0.0').on('error', async err => {
|
|
302
297
|
if (err.errno === 'EADDRINUSE') {
|
|
303
298
|
try {
|
|
304
299
|
await axios.post(ensureHTTPLink(`${this.config.host}:${port}/heartbeat`))
|
|
@@ -313,9 +308,7 @@ class Server {
|
|
|
313
308
|
|
|
314
309
|
startup() {
|
|
315
310
|
console.log('startup', this.config.enable)
|
|
316
|
-
|
|
317
|
-
this.listen(this.config.port)
|
|
318
|
-
}
|
|
311
|
+
this.listen(this.config.port)
|
|
319
312
|
}
|
|
320
313
|
|
|
321
314
|
shutdown(hasStarted) {
|