mirror of
https://github.com/GOSTSec/gostexplr
synced 2025-01-29 16:04:32 +00:00
New config
This commit is contained in:
parent
a1592acfab
commit
f45c70df51
3
app.js
3
app.js
@ -4,6 +4,7 @@ var favicon = require('serve-favicon');
|
||||
var logger = require('morgan');
|
||||
var cookieParser = require('cookie-parser');
|
||||
var bodyParser = require('body-parser');
|
||||
var env = require('./config/config.json')['env'];
|
||||
|
||||
var index = require('./routes/index');
|
||||
var address = require('./routes/address');
|
||||
@ -42,7 +43,7 @@ app.use(function(req, res, next) {
|
||||
app.use(function(err, req, res, next) {
|
||||
// set locals, only providing error in development
|
||||
res.locals.message = err.message;
|
||||
res.locals.error = req.app.get('env') === 'development' ? err : {};
|
||||
res.locals.error = env === 'development' ? err : {};
|
||||
|
||||
// render the error page
|
||||
res.status(err.status || 500);
|
||||
|
@ -1,10 +1,8 @@
|
||||
var http = require('http');
|
||||
var models = require('../models');
|
||||
var rpcConfig = require('../config/config')['rpc'];
|
||||
|
||||
const username = 'gostcoinrpc';
|
||||
const password = 'CEQLt9zrNnmyzosSV7pjb3EksAkuY9qeqoUCwDQc2wPc';
|
||||
const hostname = '127.0.0.1';
|
||||
const port = 9376;
|
||||
const {username, password, hostname, port} = rpcConfig;
|
||||
|
||||
function MakeRPCRequest(postData) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
|
@ -1,25 +1,34 @@
|
||||
{
|
||||
"development": {
|
||||
"username": "geuser",
|
||||
"password": "geuser",
|
||||
"database": "gedb",
|
||||
"host": "127.0.0.1",
|
||||
"dialect": "mysql",
|
||||
"logging": false
|
||||
"database": {
|
||||
"development": {
|
||||
"username": "geuser",
|
||||
"password": "geuser",
|
||||
"database": "gedb",
|
||||
"host": "127.0.0.1",
|
||||
"dialect": "mysql",
|
||||
"logging": false
|
||||
},
|
||||
"test": {
|
||||
"username": "root",
|
||||
"password": null,
|
||||
"database": "database_test",
|
||||
"host": "127.0.0.1",
|
||||
"dialect": "mysql"
|
||||
},
|
||||
"production": {
|
||||
"username": "geuser",
|
||||
"password": "geuser",
|
||||
"database": "gedb",
|
||||
"host": "127.0.0.1",
|
||||
"dialect": "mysql",
|
||||
"logging": false
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"username": "root",
|
||||
"password": null,
|
||||
"database": "database_test",
|
||||
"host": "127.0.0.1",
|
||||
"dialect": "mysql"
|
||||
"rpc": {
|
||||
"username": "gostcoinrpc",
|
||||
"password": "CEQLt9zrNnmyzosSV7pjb3EksAkuY9qeqoUCwDQc2wPc",
|
||||
"hostname": "127.0.0.1",
|
||||
"port": 9376
|
||||
},
|
||||
"production": {
|
||||
"username": "geuser",
|
||||
"password": "geuser",
|
||||
"database": "gedb",
|
||||
"host": "127.0.0.1",
|
||||
"dialect": "mysql",
|
||||
"logging": false
|
||||
}
|
||||
"env": "production"
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ var fs = require('fs');
|
||||
var path = require('path');
|
||||
var Sequelize = require('sequelize');
|
||||
var basename = path.basename(__filename);
|
||||
var env = process.env.NODE_ENV || 'development';
|
||||
var config = require(__dirname + '/../config/config.json')[env];
|
||||
var env = require(__dirname + '/../config/config.json')['env'] || 'development';
|
||||
var config = require(__dirname + '/../config/config.json')['database'][env];
|
||||
var db = {};
|
||||
|
||||
if (config.use_env_variable) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user