Commit 95ceb7ada7c87dedcbcaddab199fbbd52fe8de8b
1 parent
b8600145
Exists in
master
and in
1 other branch
V. 0.5.0 - Configurados os ambientes de produção e desenvolvimento
Showing
4 changed files
with
44 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,33 @@ | @@ -0,0 +1,33 @@ | ||
| 1 | +// prod.js - production keys here!! | ||
| 2 | +// dev.js - Development keys - don't commit this!!! | ||
| 3 | +module.exports = { | ||
| 4 | + googleClientID: | ||
| 5 | + "58256253974-euu83ml9oa9bs7f7et1lsmkg8ugerth1.apps.googleusercontent.com", | ||
| 6 | + googleClientSecret: "46AgUPr4-UkERnT7lXktd_GA", | ||
| 7 | + pg: { | ||
| 8 | + host: process.env.PG_HOST, // server name or IP address; | ||
| 9 | + hostaddr: process.env.PG_HOST_ADDRESS, | ||
| 10 | + port: process.env.PG_PORT, | ||
| 11 | + database: process.env.PG_DATABASE, | ||
| 12 | + user: process.env.PG_USER, | ||
| 13 | + password: process.env.PG_PWD, | ||
| 14 | + max: process.env.PG_MAX_NUMBER_OF_CLIENTS, // max number of clients in the pool | ||
| 15 | + idleTimeoutMillis: 30000 // how long a client is allowed to remain idle before being closed | ||
| 16 | + }, | ||
| 17 | + msql: { | ||
| 18 | + user: process.env.MSQL_USER, | ||
| 19 | + password: process.env.MSQL_PWD, | ||
| 20 | + server: process.env.MSQL_SERVER, // "JAVASERVER\\SQLEXPRESS", | ||
| 21 | + database: process.env.MSQL_DATABASE, | ||
| 22 | + port: process.env.MSQL_PORT, | ||
| 23 | + dialect: "mssql" | ||
| 24 | + }, | ||
| 25 | + geoserverWMS: process.env.GEOSERVER_WMS, | ||
| 26 | + waterLayers: process.env.WATER_LAYERS, | ||
| 27 | + server: process.env.GEOSERVER_WMS, | ||
| 28 | + googleClientID: process.env.GOOGLE_CLIENT_ID, | ||
| 29 | + googleClientSecret: process.env.GOOGLE_CLIENT_SECRET, | ||
| 30 | + mongoURI: process.env.MONGO_URI, | ||
| 31 | + cookieKey: process.env.COOKIE_KEY | ||
| 32 | + }; | ||
| 33 | + | ||
| 0 | \ No newline at end of file | 34 | \ 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 o SqlServer:\n" + err); |
| 13 | } | 13 | } |
| 14 | }); | 14 | }); |
| 15 | \ No newline at end of file | 15 | \ No newline at end of file |