Skip to content

Commit

Permalink
Back to basic
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Robsahm committed Nov 30, 2016
1 parent 72727db commit c1b7076
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 56 deletions.
9 changes: 0 additions & 9 deletions .babelrc

This file was deleted.

27 changes: 0 additions & 27 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.env
node_modules/
3 changes: 0 additions & 3 deletions config/index.js

This file was deleted.

2 changes: 0 additions & 2 deletions env.manifest

This file was deleted.

9 changes: 3 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const ws = require("ws");
const url = require("url");
const config = require("./config");

const requestConfig = (webSocket, environment) => {
webSocket.send(environment);
Expand All @@ -11,14 +10,14 @@ const startUpdateConfig = (environment) => {
let interval;

const connect = () => {
const webSocket = new ws(url.resolve(config.get("CONFIG_SERVICE_URL"), environment));
const webSocket = new ws(url.resolve(process.env.CONFIG_SERVICE_URL, environment));

webSocket.on("open", () => {
retryNumOfTimes = 0;
requestConfig(webSocket, environment);
interval = setInterval(
requestConfig,
config.get("INTERVAL"),
process.env.INTERVAL,
webSocket,
environment
);
Expand All @@ -42,6 +41,4 @@ const startUpdateConfig = (environment) => {
connect();
};

module.exports = startUpdateConfig;

//startUpdateConfig("dev");
module.exports = startUpdateConfig;
8 changes: 0 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,9 @@
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node .",
"dev-start": "nf run npm run start -s"
},
"author": "Alex Robsahm",
"license": "ISC",
"devDependencies": {
"foreman": "^2.0.0"
},
"dependencies": {
"varium": "github:ahultgren/node-varium",
"ws": "^1.1.1"
}
}

0 comments on commit c1b7076

Please sign in to comment.