unprint 0.19.0 → 0.19.1
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/package.json +1 -1
- package/src/app.js +2 -2
- package/src/server.js +7 -2
- package/tests/remote.js +1 -1
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -22,7 +22,7 @@ const settings = {
|
|
|
22
22
|
requestTimeout: 30000,
|
|
23
23
|
userAgent: 'unprint',
|
|
24
24
|
remote: {
|
|
25
|
-
|
|
25
|
+
enable: false,
|
|
26
26
|
address: 'http://127.0.0.1:3333/browser',
|
|
27
27
|
methods: ['browser'],
|
|
28
28
|
},
|
|
@@ -1380,7 +1380,7 @@ async function remoteRequest(url, method, options) {
|
|
|
1380
1380
|
}
|
|
1381
1381
|
|
|
1382
1382
|
function useRemoteRequest(options, method) {
|
|
1383
|
-
if (options.remote.
|
|
1383
|
+
if (options.remote.enable) {
|
|
1384
1384
|
if (options.useRemote) {
|
|
1385
1385
|
return true;
|
|
1386
1386
|
}
|
package/src/server.js
CHANGED
|
@@ -42,7 +42,7 @@ function curateOptions(options) {
|
|
|
42
42
|
return {
|
|
43
43
|
...options,
|
|
44
44
|
remote: {
|
|
45
|
-
|
|
45
|
+
enable: false,
|
|
46
46
|
},
|
|
47
47
|
useRemote: false,
|
|
48
48
|
control: options.control
|
|
@@ -124,7 +124,12 @@ async function initServer(address, unprint) {
|
|
|
124
124
|
});
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
app.listen(port, host, () => {
|
|
127
|
+
app.listen(port, host, (error) => {
|
|
128
|
+
if (error) {
|
|
129
|
+
logger.error(`Failed to start server: ${error.message}`);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
|
|
128
133
|
logger.info(`Started unprint server on ${host}:${port}`);
|
|
129
134
|
});
|
|
130
135
|
}
|