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) {
|
app.get('/', function(req, res) {
|
||||||
res.send('Hello World!');
|
res.send('Hello World!');
|
||||||
});
|
});
|
||||||
|
require('dotenv').config()
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
app.use(express.json()) // for parsing application/json
|
app.use(express.json()) // for parsing application/json
|
||||||
app.use(express.urlencoded({ extended: true }))
|
app.use(express.urlencoded({ extended: true }))
|
||||||
app.use(require('./routes/index.js'))
|
app.use(require('./routes/index.js'))
|
||||||
app.listen(3000, function() {
|
app.listen(process.env.PORT, function() {
|
||||||
console.log('Example app listening on port 3000!');
|
console.log('Example app listening on port ' + process.env.PORT + '!');
|
||||||
});
|
});
|
||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
var mysql = require('mysql');
|
var mysql = require('mysql');
|
||||||
var connection = mysql.createConnection({
|
var connection = mysql.createConnection({
|
||||||
host: 'localhost',
|
host: process.env.HOSTDB,
|
||||||
user: 'root',
|
user: process.env.USERDB,
|
||||||
password: 'george',
|
password: process.env.PASSDB,
|
||||||
database: 'coloquio_educacion'
|
database: process.env.DB
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = connection;
|
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"
|
"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": {
|
"ee-first": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bcrypt": "^3.0.8",
|
"bcrypt": "^3.0.8",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
"dotenv": "^8.2.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"express-fileupload": "^1.1.6",
|
"express-fileupload": "^1.1.6",
|
||||||
"randomstring": "^1.1.5",
|
"randomstring": "^1.1.5",
|
||||||
|
|||||||
Reference in New Issue
Block a user