Browse Source

Change environment variables

pull/1/head
rozetko 7 years ago
parent
commit
c49f4c1992
  1. 2
      server/src/index.ts
  2. 2
      src/data_provider.py

2
server/src/index.ts

@ -7,7 +7,7 @@ import { router as alertsRouter } from './routes/alerts';
import { tgBotInit } from './services/notification'; import { tgBotInit } from './services/notification';
const app = express(); const app = express();
const PORT = 8000; const PORT = process.env.HASTIC_PORT || 8000;
app.use(bodyParser.json()); app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.urlencoded({ extended: true }));

2
src/data_provider.py

@ -136,7 +136,7 @@ class DataProvider:
def __query_grafana(self, params): def __query_grafana(self, params):
headers = { 'Authorization': 'Bearer ' + os.environ['API_KEY'] } headers = { 'Authorization': 'Bearer ' + os.environ['HASTIC_API_KEY'] }
url = self.datasource['origin'] + '/' + self.datasource['url'] + '?' + urlencode(params) url = self.datasource['origin'] + '/' + self.datasource['url'] + '?' + urlencode(params)
req = urllib.request.Request(url, headers=headers) req = urllib.request.Request(url, headers=headers)

Loading…
Cancel
Save