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

Commit

Permalink
remove assignloudly for proxyport
Browse files Browse the repository at this point in the history
  • Loading branch information
sw-yx committed Apr 29, 2019
1 parent 62540c0 commit 09662c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
12 changes: 2 additions & 10 deletions src/detect-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,11 @@ module.exports.serverSettings = async devConfig => {
); // if settings.command is empty, its bc no settings matched
}
if (devConfig.port) {
settings.proxyPort = assignLoudly(
devConfig.port,
settings.proxyPort || null,
tellUser("proxyPort")
); // if settings.proxyPort is empty, its bc no settings matched
settings.proxyPort = devConfig.port || settings.proxyPort;
const regexp =
devConfig.urlRegexp ||
new RegExp(`(http://)([^:]+:)${devConfig.port}(/)?`, "g");
settings.urlRegexp = assignLoudly(
settings.urlRegexp,
regexp,
tellUser("urlRegexp")
);
settings.urlRegexp = settings.urlRegexp || regexp;
}
settings.dist = devConfig.publish || settings.dist; // dont loudassign if they dont need it
}
Expand Down
17 changes: 6 additions & 11 deletions src/functions-templates/js/fauna-graphql/sync-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ function createFaunaGraphQL() {
}
console.log("Upload GraphQL Schema!");

var request = require("request");
const fetch = require("node-fetch");
const fs = require("fs");
const path = require("path");
var dataString = fs
.readFileSync(path.join(__dirname, "schema.graphql"))
.toString(); // name of your schema file

var options = {
url: "https://graphql.fauna.com/import",
method: "POST",
body: dataString,
auth: {
Expand All @@ -24,16 +23,12 @@ function createFaunaGraphQL() {
}
};

request(options, callback);

function callback(error, response, body) {
if (!error && response.statusCode == 200) {
// // for debugging
fetch("https://graphql.fauna.com/import", options)
.then(body => {
// // uncomment for debugging
// console.log("body", body);
} else {
console.error("something wrong happened: ", { error, body });
}
}
})
.catch(err => console.error("something wrong happened: ", { err }));
}

createFaunaGraphQL();

0 comments on commit 09662c5

Please sign in to comment.