Skip to content

Commit

Permalink
Primer commit
Browse files Browse the repository at this point in the history
  • Loading branch information
luisredondo committed Dec 31, 2018
0 parents commit 29cb982
Show file tree
Hide file tree
Showing 35 changed files with 25,887 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/
20 changes: 20 additions & 0 deletions app-old.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const http = require('http');

http.createServer((req, res) => {

res.writeHead(200, { 'Content-Type': 'application/json' });

let salida = {
nombre: 'Redondo',
edad: 19,
url: req.url
}

res.write(JSON.stringify(salida));
// res.write('Hola Mundo');
res.end();

})
.listen(8080);

console.log('Escuchando el puerto 8080');
17 changes: 17 additions & 0 deletions hbs/helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const hbs = require('hbs');

// helpers
hbs.registerHelper('getAnio', () => {
return new Date().getFullYear();
});

hbs.registerHelper('capitalizar', (texto) => {

let palabras = texto.split(' ');
palabras.forEach((palabra, index) => {
palabras[index] = palabra.charAt(0).toUpperCase() + palabra.slice(1).toLowerCase();
});

return palabras.join(' ');

});
Loading

0 comments on commit 29cb982

Please sign in to comment.