Skip to content

Commit

Permalink
Refactor to single index file (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
smyrick committed Jul 3, 2023
1 parent 563a2d5 commit 961f83f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
8 changes: 6 additions & 2 deletions dev.js → index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { startSubgraphs } from './subgraphs/subgraphs.js';
// See supergraph-config-dev.yaml for config setup
(async () => {
// start subgraphs in monolith mode
// If you change this port, update rover dev config
await startSubgraphs(4001);
let port = undefined;
if (process.env.NODE_ENV === 'dev') {
// If you change this port for local dev, update rover dev config
port = 4001;
}
await startSubgraphs(port);
})();
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"scripts": {
"dev": "npm run dev:subgraphs & npm run dev:router",
"dev:subgraphs": "NODE_ENV=dev nodemon dev.js",
"dev:subgraphs": "NODE_ENV=dev nodemon index.js",
"dev:router": "rover dev --supergraph-config supergraph-config-dev.yaml --router-config router-config-dev.yaml",
"start": "node prod.js",
"start": "node index.js",
"test": "npm run test:compile && npm run test:compose",
"test:compose": "APOLLO_ELV2_LICENSE=accept rover supergraph compose --config supergraph-config-dev.yaml --output supergraph.graphql",
"test:compile": "tsc"
Expand Down
8 changes: 0 additions & 8 deletions prod.js

This file was deleted.

0 comments on commit 961f83f

Please sign in to comment.