Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /node
- . /config
- . default.js
- . node_modules
- . /controllers
- . myfile.js
- . other files
- . app.js
- const express = require('express');
- const app = express();
- const mysql = require('mysql');
- const path = require('path');
- const config = require('config');
- const bodyParser = require('body-parser');
- const moment = require('moment');
- app.use(bodyParser.json({type: '*/*'}));
- var client;
- const redis = require("redis");
- client = redis.createClient();
- client.on("error", function (err) {
- console.log("Error " + err);
- });
- const connectionPool = mysql.createPool({
- host: config.get('database.host'),
- user: config.get('database.user'),
- password: config.get('database.password'),
- database: config.get('database.dbname'),
- connectionLimit: 2
- });
- function selectUpdatedData() {
- connectionPool.query("SELECT * FROM rc_devices_notifications", function (err, rows, fields) {
- //DO STUFF
- process.exit();
- });
- }
- selectUpdatedData();
- WARNING: No configurations found in configuration directory:/home/rc-user/node/controllers/config
- WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.
- /home/rc-user/node/node_modules/config/lib/config.js:181
- throw new Error('Configuration property "' + property + '" is not defined');
- ^
- Error: Configuration property "database.host" is not defined
- at Config.get (/home/rc-user/node/node_modules/config/lib/config.js:181:11)
- at Object.<anonymous> (/home/rc-user/node/controllers/update_trackers.js:20:18)
- at Module._compile (module.js:573:32)
- at Object.Module._extensions..js (module.js:582:10)
- at Module.load (module.js:490:32)
- at tryModuleLoad (module.js:449:12)
- at Function.Module._load (module.js:441:3)
- at Module.runMain (module.js:607:10)
- at run (bootstrap_node.js:420:7)
- at startup (bootstrap_node.js:139:9)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement