Skip to content

Commit f429b46

Browse files
authored
Merge pull request #259 from Dan-Nolan/task/configurable_port
Configurable Server Port
2 parents 78d85c4 + a03d724 commit f429b46

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

ci/config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ const LANGUAGE_VERSIONS = {
1111
javascript: ['10.x', '10.x/babel']
1212
}
1313

14-
const GRAPH_API = process.env.GRAPH_API || "http://localhost:3040/graphql";
14+
const BUILDER_PORT = process.env.BUILDER_PORT || 3040;
15+
16+
const GRAPH_API = process.env.GRAPH_API || `http://localhost:${BUILDER_PORT}/graphql`;
1517

1618
const RUN_URL = process.env.RUN_URL || "https://relayer-staging.chainshot.com/run/";
1719

1820
module.exports = {
1921
LANGUAGE_VERSIONS,
2022
EXECUTION_RESULTS,
23+
BUILDER_PORT,
2124
GRAPH_API,
2225
RUN_URL,
2326
}

ci/startServer.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
const childProcess = require("child_process");
22
const path = require("path");
3+
const { BUILDER_PORT } = require('./config');
34
const serverPath = path.join(__dirname, "..", "server");
45

56
function startServer() {
67
return new Promise((resolve, reject) => {
78
const npmChild = childProcess.exec("npm i", { cwd: serverPath });
89
npmChild.on("exit", () => {
910
const child = childProcess.fork('src/index', [], {
10-
CONTENT_PATH: process.env.contentPath,
11-
CONTENT_REPO_NAME: process.env.contentRepoName,
1211
cwd: serverPath,
1312
detached: true,
1413
silent: false,
15-
env: { QUERY_ONLY: true }
14+
env: {
15+
CONTENT_PATH: process.env.CONTENT_PATH,
16+
CONTENT_REPO_NAME: process.env.CONTENT_REPO_NAME,
17+
QUERY_ONLY: true,
18+
PORT: BUILDER_PORT
19+
}
1620
});
1721
child.on('message', (msg) => {
1822
if(msg === "started") {

0 commit comments

Comments
 (0)