Skip to content

Commit

Permalink
Todo listo para trabajar
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus Mur committed Oct 30, 2014
0 parents commit d338cb2
Show file tree
Hide file tree
Showing 5 changed files with 73 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
26 changes: 26 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var express = require('express');
var app = module.exports = express();

var morgan = require('morgan');
var swig = require('swig');

app.engine('html', swig.renderFile);

app.set('view engine', 'html');
app.set('views', __dirname + '/views');


app.use(morgan('dev'));

app.get('/', function (req, res) {
res.render('index', {message: 'hola mundo'});
});

var port = 3000;
app.listen(port, function (err) {
if (err) {
console.log('Error del servidor ' + err);
} else {
console.log('servidor corriendo en el puerto ' + port);
};
});
16 changes: 16 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var gulp = require('gulp');
var nodemon = require('gulp-nodemon');

gulp.task('default', function() {
console.log('Tarea de prueba');
});

gulp.task('develop', function () {
nodemon({ script: 'app.js', ext: 'html js', ignore: [] })
.on('change', [])
.on('restart', function () {
console.log('restarted!')
});
});

gulp.task('default',['develop']);
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "ngusers",
"version": "1.0.0",
"description": "Angular learning",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Jesús Mur Fontanals",
"license": "MIT",
"dependencies": {
"express": "^4.10.1",
"morgan": "^1.4.1",
"swig": "^1.4.2"
},
"devDependencies": {
"gulp": "^3.8.9",
"gulp-nodemon": "^1.0.4"
}
}
10 changes: 10 additions & 0 deletions views/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ng-Users</title>
</head>
<body>
<h1>{{message}}</h1>
</body>
</html>

0 comments on commit d338cb2

Please sign in to comment.