actualziacon del .env

This commit is contained in:
DanielRamirezGe
2020-02-14 20:40:21 -06:00
parent af6bf73d0c
commit e7efe6a46d
12 changed files with 26 additions and 6 deletions
+11
View File
@@ -0,0 +1,11 @@
TYPEDB =
DB =
USERDB =
PASSDB =
HOSTDB =
PORT =
+2
View File
@@ -0,0 +1,2 @@
node_modules
.env
+3 -2
View File
@@ -4,10 +4,11 @@ var cors = require('cors');
app.get('/', function(req, res) {
res.send('Hello World!');
});
require('dotenv').config()
app.use(cors());
app.use(express.json()) // for parsing application/json
app.use(express.urlencoded({ extended: true }))
app.use(require('./routes/index.js'))
app.listen(3000, function() {
console.log('Example app listening on port 3000!');
app.listen(process.env.PORT, function() {
console.log('Example app listening on port ' + process.env.PORT + '!');
});
+4 -4
View File
@@ -1,9 +1,9 @@
var mysql = require('mysql');
var connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: 'george',
database: 'coloquio_educacion'
host: process.env.HOSTDB,
user: process.env.USERDB,
password: process.env.PASSDB,
database: process.env.DB
});
module.exports = connection;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+5
View File
@@ -241,6 +241,11 @@
"libmime": "^2.0.3"
}
},
"dotenv": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
"integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw=="
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+1
View File
@@ -16,6 +16,7 @@
"dependencies": {
"bcrypt": "^3.0.8",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"express-fileupload": "^1.1.6",
"randomstring": "^1.1.5",