diff --git a/Dockerfile b/Dockerfile index a92df0a..88085ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ARG build_path=/var/www ENV BUILD_PATH=$build_path # Expose port 80 -EXPOSE 80 +EXPOSE 8000 VOLUME [ "/var/www/exported" ] diff --git a/README.md b/README.md index e3489e3..c5056c1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Server for fetching data from Grafana datasources -Running on 80 port in Docker container. +Running on 8000 port in Docker container. Dockerfile has 2 volumes: diff --git a/package.json b/package.json index 7b75b87..c8169df 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "express": "^4.16.3", "fast-csv": "^2.4.1", "moment": "^2.22.1", - "node-fetch": "^2.1.2", "nodemon": "^1.17.3", "ts-loader": "^3.5.0", "typescript": "^2.8.3", diff --git a/src/config.ts b/src/config.ts index b8dea22..6d5bf3a 100644 --- a/src/config.ts +++ b/src/config.ts @@ -5,12 +5,7 @@ export const EXPORTED_PATH = path.join(__dirname, '../exported'); export function getApiKey(host) { - return new Promise((resolve, reject) => { - fs.readFile(path.join(__dirname, '../api-keys.json'), 'utf8', (err, data) => { - if(err) { - reject(err); - } - resolve(JSON.parse(data)[host]); - }); - }); + let data = fs.readFileSync(path.join(__dirname, '../api-keys.json'), 'utf8'); + + return JSON.parse(data)[host] } diff --git a/src/index.ts b/src/index.ts index f827a03..c8f95e7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ import * as express from 'express'; import * as bodyParser from 'body-parser'; const app = express(); -const PORT = 80; +const PORT = 8000; app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true }));