Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pilisign committed Dec 24, 2018
0 parents commit 2fcc9d6
Show file tree
Hide file tree
Showing 19 changed files with 1,225 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
34 changes: 34 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// 1) Me traigo express
const express = require("express");
// 2) Me traigo bodyparser
const bodyParser = require("body-parser");
// 3) Me traigo las rutas que necesito "escuchar"
const apiRoutes = require("./routes/apiRoutes");
const indexRoutes = require("./routes/indexRoutes");
// const adminRoutes = require("./routes/adminRoutes");
// const vendorRoutes = require("./routes/vendorRoutes");
const path = require ("path");

// 4) Defino mi aplicacion con express
const app = express();

// 5) Le digo a mi servidor que use bodyParser
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

// 6) Le digo a mi servidor que cuando el cliente haga una peticion
// vaya a buscar la ruta correspondiente
// app.use("/", routes);
// agrego esto porque no tengo variables de entorno (extensions.js?)
app.listen(3000, function(){console.log('server listening')});

// app.use("/admin", adminRoutes)
// app.use("/vendor", vendorRoutes)

// esta es la ruta de los archivos estaticos
app.use(express.static(path.join(__dirname, "/public")));

app.use("/api", apiRoutes);
app.use("/", indexRoutes);

module.exports = app;
31 changes: 31 additions & 0 deletions edit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<link rel="stylesheet" href="/css/style.css">
<title>Editar Usuario</title>
</head>
<body>
<section>
<div class="title">
<h2>Editar usuario</h2>
</div>
<div class="formulario">
<form>
<div class="field"><i class="fas fa-user"></i><input type="text" maxlength="30" placeholder="Nombre" name="nombre"></div>
<div class="field"><span style="padding-right: 15px"></span><input type="text" maxlength="30" placeholder="Apellido" name="apellido"></div>
<div class="field"><i class="fas fa-phone"></i><input type="text" placeholder="Email" name="email"></div>
<div class="field"><i class="fas fa-envelope"></i><input type="text" placeholder="Telefono" name="telefono"></div>
<div class="footer-form">
<button id="btn-edit" type="button">Guardar Cambios</button>
</div>
</form>
</section>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="/javascripts/edit.js"></script>
</body>
</html>
28 changes: 28 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<link rel="stylesheet" href="/css/style.css">
<title>CRUD</title>
</head>
<body>
<div class="users-table">
<div class="form-container">
<form id="filter-form">
<input type="text" name="filtro" placeholder="Buscar...">
<button type="button" class="btn-filter"><i class="fas fa-search"></i></button>
</form>
</div>
<table id="table-users"></table>
<div class="footer-table">
<a href="/index/new"><button id="btn-nuevo"><i class="fas fa-user-plus"></i> Agregar</button></a>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="/javascripts/index.js"></script>
</body>
</html>
28 changes: 28 additions & 0 deletions new.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<link rel="stylesheet" href="/css/style.css">
<title>Nuevo usuario</title>
</head>
<body>
<section>
<div class="title">
<h2>Ingresar nuevo usuario</h2>
</div>
<div class="formulario">
<div class="field"><i class="fas fa-user"></i><input type="text" name="name" placeholder="Nombre"></div>
<div class="field"><span style="padding-right: 14px"></span><input type="text" name="lastname" placeholder="Apellido"></div>
<div class="field"><i class="fas fa-phone"></i><input type="number" name="phone" placeholder="Teléfono"></div>
<div class="field"><i class="fas fa-envelope"></i><input type="text" name="email" placeholder="Email"></div>
<div class="footer-form"><button id="form" type="button"><i class="fas fa-check"></i> Guardar</button></div>
</div>
</section>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="/javascripts/new.js"></script>
</html>
Loading

0 comments on commit 2fcc9d6

Please sign in to comment.