Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit 09662c5

Browse files
author
sw-yx
committed
remove assignloudly for proxyport
1 parent 62540c0 commit 09662c5

File tree

2 files changed

+8
-21
lines changed

2 files changed

+8
-21
lines changed

src/detect-server.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,11 @@ module.exports.serverSettings = async devConfig => {
117117
); // if settings.command is empty, its bc no settings matched
118118
}
119119
if (devConfig.port) {
120-
settings.proxyPort = assignLoudly(
121-
devConfig.port,
122-
settings.proxyPort || null,
123-
tellUser("proxyPort")
124-
); // if settings.proxyPort is empty, its bc no settings matched
120+
settings.proxyPort = devConfig.port || settings.proxyPort;
125121
const regexp =
126122
devConfig.urlRegexp ||
127123
new RegExp(`(http://)([^:]+:)${devConfig.port}(/)?`, "g");
128-
settings.urlRegexp = assignLoudly(
129-
settings.urlRegexp,
130-
regexp,
131-
tellUser("urlRegexp")
132-
);
124+
settings.urlRegexp = settings.urlRegexp || regexp;
133125
}
134126
settings.dist = devConfig.publish || settings.dist; // dont loudassign if they dont need it
135127
}

src/functions-templates/js/fauna-graphql/sync-schema.js

+6-11
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ function createFaunaGraphQL() {
77
}
88
console.log("Upload GraphQL Schema!");
99

10-
var request = require("request");
10+
const fetch = require("node-fetch");
1111
const fs = require("fs");
1212
const path = require("path");
1313
var dataString = fs
1414
.readFileSync(path.join(__dirname, "schema.graphql"))
1515
.toString(); // name of your schema file
1616

1717
var options = {
18-
url: "https://graphql.fauna.com/import",
1918
method: "POST",
2019
body: dataString,
2120
auth: {
@@ -24,16 +23,12 @@ function createFaunaGraphQL() {
2423
}
2524
};
2625

27-
request(options, callback);
28-
29-
function callback(error, response, body) {
30-
if (!error && response.statusCode == 200) {
31-
// // for debugging
26+
fetch("https://graphql.fauna.com/import", options)
27+
.then(body => {
28+
// // uncomment for debugging
3229
// console.log("body", body);
33-
} else {
34-
console.error("something wrong happened: ", { error, body });
35-
}
36-
}
30+
})
31+
.catch(err => console.error("something wrong happened: ", { err }));
3732
}
3833

3934
createFaunaGraphQL();

0 commit comments

Comments
 (0)