Commit 2c0df38598c9fb403c4eaabd46a76cbe0e5a7b3a
1 parent
b8600145
Exists in
master
and in
1 other branch
V. 0.5.1 - Configurados os ambientes de produção e desenvolvimento
Showing
4 changed files
with
42 additions
and
2 deletions
Show diff stats
.gitignore
| @@ -0,0 +1,9 @@ | @@ -0,0 +1,9 @@ | ||
| 1 | +// keys.js - figure out what set of credentials to return | ||
| 2 | +// NODE_ENV - variável do Heroku que informa que estamos em production. o Heroku configura esta variável | ||
| 3 | +if (process.env.NODE_ENV === "production") { | ||
| 4 | + // we are in production - return the production set of keys | ||
| 5 | + module.exports = require ("./prod"); | ||
| 6 | +} else { | ||
| 7 | + // we are in development - return the dev keys | ||
| 8 | + module.exports = require("./dev"); | ||
| 9 | +} |
| @@ -0,0 +1,31 @@ | @@ -0,0 +1,31 @@ | ||
| 1 | +// prod.js - production keys here!! | ||
| 2 | +// dev.js - Development keys - don't commit this!!! | ||
| 3 | +module.exports = { | ||
| 4 | + googleClientID: | ||
| 5 | + pg: { | ||
| 6 | + host: process.env.PG_HOST, // server name or IP address; | ||
| 7 | + hostaddr: process.env.PG_HOST_ADDRESS, | ||
| 8 | + port: process.env.PG_PORT, | ||
| 9 | + database: process.env.PG_DATABASE, | ||
| 10 | + user: process.env.PG_USER, | ||
| 11 | + password: process.env.PG_PWD, | ||
| 12 | + max: process.env.PG_MAX_NUMBER_OF_CLIENTS, // max number of clients in the pool | ||
| 13 | + idleTimeoutMillis: 30000 // how long a client is allowed to remain idle before being closed | ||
| 14 | + }, | ||
| 15 | + msql: { | ||
| 16 | + user: process.env.MSQL_USER, | ||
| 17 | + password: process.env.MSQL_PWD, | ||
| 18 | + server: process.env.MSQL_SERVER, // "JAVASERVER\\SQLEXPRESS", | ||
| 19 | + database: process.env.MSQL_DATABASE, | ||
| 20 | + port: process.env.MSQL_PORT, | ||
| 21 | + dialect: "mssql" | ||
| 22 | + }, | ||
| 23 | + geoserverWMS: process.env.GEOSERVER_WMS, | ||
| 24 | + waterLayers: process.env.WATER_LAYERS, | ||
| 25 | + server: process.env.GEOSERVER_WMS, | ||
| 26 | + googleClientID: process.env.GOOGLE_CLIENT_ID, | ||
| 27 | + googleClientSecret: process.env.GOOGLE_CLIENT_SECRET, | ||
| 28 | + mongoURI: process.env.MONGO_URI, | ||
| 29 | + cookieKey: process.env.COOKIE_KEY | ||
| 30 | + }; | ||
| 31 | + | ||
| 0 | \ No newline at end of file | 32 | \ No newline at end of file |
services/databases.js
| @@ -9,6 +9,6 @@ pg.defaults.poolSize = 25; | @@ -9,6 +9,6 @@ pg.defaults.poolSize = 25; | ||
| 9 | global.poolPg = new pg.Pool(keys.pg); | 9 | global.poolPg = new pg.Pool(keys.pg); |
| 10 | global.poolMsql = new ms_sql.ConnectionPool(keys.msql, function(err) { | 10 | global.poolMsql = new ms_sql.ConnectionPool(keys.msql, function(err) { |
| 11 | if (err) { | 11 | if (err) { |
| 12 | - console.log("Não conectou \n" + err); | 12 | + console.log("Não conectou com SQLServer:\n" + err); |
| 13 | } | 13 | } |
| 14 | }); | 14 | }); |
| 15 | \ No newline at end of file | 15 | \ No newline at end of file |