-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc3b831
commit b467bc5
Showing
9 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"servidordb": { | ||
"host": "", | ||
"user": "", | ||
"password": "", | ||
"database": "" | ||
}, | ||
"servidor":{ | ||
"puerto":5000 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const mysql = require('mysql') | ||
const config = require('config'); | ||
|
||
//rutas para la conexion a base de datos | ||
const host = config.get('servidordb.host'); | ||
const user = config.get('servidordb.user'); | ||
const pass = config.get('servidordb.password'); | ||
const database = config.get('servidordb.database'); | ||
|
||
const pool = mysql.createPool({ | ||
connectionLimit: 4, | ||
waitForConnections: true, | ||
queueLimit: 0, | ||
host: host, | ||
user: user, | ||
password: pass, | ||
database: database | ||
}) | ||
|
||
pool.getConnection((err, connection) => { | ||
if(err){ | ||
console.log('error al conectar a la base de datos'); | ||
}else{ | ||
console.log('se conecto a la base de datos'); | ||
} | ||
}) | ||
|
||
module.exports = pool; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const express = require('express'); | ||
const path = require('path'); | ||
const bodyParser = require('body-parser'); | ||
const config = require('config'); | ||
|
||
//mysql | ||
const conn = require('./database/db.js'); | ||
|
||
//puerto | ||
const puerto = config.get('servidor.puerto'); | ||
const PORT = process.env.PORT || puerto; | ||
|
||
//app | ||
const app = express(); | ||
//utilidades | ||
app.set('view engine', 'ejs'); | ||
app.use(express.static('public')); | ||
|
||
//respuesta del servidor | ||
let respuesta = { | ||
error: false, | ||
codigo: 0, | ||
mensaje: '', | ||
parametro: '', | ||
} | ||
|
||
const urlencodedParser = bodyParser.urlencoded({extended: true}); | ||
app.use(bodyParser.json()) // for parsing application/json | ||
const jsonParser = bodyParser.json(); | ||
|
||
|
||
//logica de la app | ||
//logica de la app | ||
|
||
|
||
//corre el servidor | ||
app.listen(PORT, () => { | ||
console.log(`se conecto al: http://localhost:${PORT}`); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "proyectoapp", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "Daniel Arango Villegas <[email protected]> (https://github.com/daniel-990)", | ||
"license": "ISC" | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Esta es mi pagina de inicio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>web</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous"> | ||
</head> | ||
<body> | ||
<nav class="navbar navbar-expand-lg bg-body-tertiary"> | ||
<div class="container-fluid"> | ||
<a class="navbar-brand" href="#">Logo</a> | ||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navbarNav"> | ||
<ul class="navbar-nav"> | ||
<li class="nav-item"> | ||
<a class="nav-link active" aria-current="page" href="#">Inicio</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="#">Info</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> |