actualziacon del .env
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
TYPEDB =
|
||||
|
||||
DB =
|
||||
|
||||
USERDB =
|
||||
|
||||
PASSDB =
|
||||
|
||||
HOSTDB =
|
||||
|
||||
PORT =
|
||||
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
.env
|
||||
@@ -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
@@ -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.
Generated
+5
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user