Browse Source

🔨 Change dev.js to keys.js

No need at the moment for multiple key files.
main
Haris Razis 4 years ago
parent
commit
d4390608e3
No known key found for this signature in database GPG Key ID: 86A4D290ED03FAB4
  1. 4
      server/actions/influx_actions.js
  2. 10
      server/config/keys.js
  3. 12
      server/index.js

4
server/actions/influx_actions.js

@ -1,8 +1,8 @@
const {Point} = require('@influxdata/influxdb-client');
const chalk = require('chalk')
const {writeApi, queryApi} = require('../connections/db_conn')
const {bucket} = require('../config/dev')
const {writeApi, queryApi} = require('../connections/influx_conn')
const {bucket} = require('../config/keys')
write = (pointName, uuid, measurement) => {
const point = new Point(pointName)

10
server/config/keys.js

@ -0,0 +1,10 @@
module.exports = {
influx_url: 'http://0.0.0.0',
influx_token: '',
influx_org: '',
influx_bucket: '',
redis_user: '',
redis_password: '',
redis_host: '0.0.0.0',
redis_port: '7001'
}

12
server/index.js

@ -1,8 +1,14 @@
const express = require('express')
const app = express()
const app = require('express')()
const server = require('http').createServer(app);
const chalk = require('chalk')
const redis = require('./connections/redis_conn')
const influx = require('./connections/influx_conn')
const socket = require('./services/socket')(server)
const measurementRoute = require('./routes/data')
app.use(measurementRoute)
module.exports = app;
server.listen(3000);
console.log(chalk.green.bold('Server listening on port 3000!'));
Loading…
Cancel
Save