Skip to content

Commit

Permalink
Added node progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukhu committed Aug 1, 2018
1 parent c3f8181 commit c678da0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nxplorerjs-microservice",
"version": "1.9.9",
"version": "1.9.10",
"description": "Express Microservice Starter Project",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -73,6 +73,7 @@
"lodash": "^4.17.10",
"node-fetch": "^2.2.0",
"pino": "^4.17.5",
"progress": "^2.0.0",
"prom-client": "^11.1.1",
"randexp": "^0.5.0",
"reflect-metadata": "^0.1.12",
Expand Down
Binary file modified screenshots/nxplorerjs.pptx
Binary file not shown.
10 changes: 8 additions & 2 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { configHystrix, configGraphQL } from '../server/common/config';
import * as cluster from 'cluster';
import * as os from 'os';
import * as http from 'http';
import * as ProgressBar from 'progress';

// Single Node execution
// tslint:disable:no-console
Expand All @@ -16,15 +17,20 @@ const welcome = port =>

const setupServer = () => {
// create server
const bar = new ProgressBar('[:bar] :percent :elapseds', { total: 6 });
bar.tick();
const app = new Server().getServer().build();
bar.tick();
const apolloServer: ApolloServer = configGraphQL(app);
bar.tick();
// Create Server so that it can be reused for the
// configuring the SubscriptionServer
const ws = http.createServer(app);

bar.tick();
if (process.env.GRAPHQL_SUBSCRIPTIONS === 'true') {
apolloServer.installSubscriptionHandlers(ws);
}
bar.tick();
// console.log(apolloServer.subscriptionsPath);
ws.listen(process.env.PORT, err => {
if (err) {
Expand All @@ -35,7 +41,7 @@ const setupServer = () => {
// configure Hystrix Support
configHystrix();
}

bar.tick();
welcome(process.env.PORT);
});
};
Expand Down

0 comments on commit c678da0

Please sign in to comment.