Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Salazar committed Jun 19, 2018
0 parents commit 8713e4e
Show file tree
Hide file tree
Showing 35 changed files with 27,581 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

node_modules/
18 changes: 18 additions & 0 deletions app-old.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const http = require('http');

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

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

let salida ={
nombre: 'Antonio',
edad: 24,
url: req.url
}

res.write( JSON.stringify( salida ))
res.end()
})
.listen(8080)

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

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

hbs.registerHelper('capitalize', (text) =>{
let words = text.split(' ')
words.forEach( (word, idx) =>{
words[idx] = word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
});
return words.join(' ');
})
Loading

0 comments on commit 8713e4e

Please sign in to comment.