Commit 25b87271 authored by Javi's avatar Javi

first upload

parents
{
"directory": "app/bower_components"
}
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# Change these settings to your own preference
indent_style = space
indent_size = 2
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
* text=auto
\ No newline at end of file
node_modules
public
.tmp
.sass-cache
app/bower_components
heroku
/views
dist
\ No newline at end of file
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"globals": {
"angular": false
}
}
language: node_js
node_js:
- '0.8'
- '0.10'
before_script:
- 'npm install -g bower grunt-cli'
- 'bower install'
This diff is collapsed.
*.coffee
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page Not Found :(</title>
<style>
::-moz-selection {
background: #b3d4fc;
text-shadow: none;
}
::selection {
background: #b3d4fc;
text-shadow: none;
}
html {
padding: 30px 10px;
font-size: 20px;
line-height: 1.4;
color: #737373;
background: #f0f0f0;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
html,
input {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
body {
max-width: 500px;
_width: 500px;
padding: 30px 20px 50px;
border: 1px solid #b3b3b3;
border-radius: 4px;
margin: 0 auto;
box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
background: #fcfcfc;
}
h1 {
margin: 0 10px;
font-size: 50px;
text-align: center;
}
h1 span {
color: #bbb;
}
h3 {
margin: 1.5em 0 0.5em;
}
p {
margin: 1em 0;
}
ul {
padding: 0 0 0 40px;
margin: 1em 0;
}
.container {
max-width: 380px;
_width: 380px;
margin: 0 auto;
}
/* google search */
#goog-fixurl ul {
list-style: none;
padding: 0;
margin: 0;
}
#goog-fixurl form {
margin: 0;
}
#goog-wm-qt,
#goog-wm-sb {
border: 1px solid #bbb;
font-size: 16px;
line-height: normal;
vertical-align: top;
color: #444;
border-radius: 2px;
}
#goog-wm-qt {
width: 220px;
height: 20px;
padding: 5px;
margin: 5px 10px 0 0;
box-shadow: inset 0 1px 1px #ccc;
}
#goog-wm-sb {
display: inline-block;
height: 32px;
padding: 0 10px;
margin: 5px 0 0;
white-space: nowrap;
cursor: pointer;
background-color: #f5f5f5;
background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1);
background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1);
background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1);
background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1);
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
*overflow: visible;
*display: inline;
*zoom: 1;
}
#goog-wm-sb:hover,
#goog-wm-sb:focus {
border-color: #aaa;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
background-color: #f8f8f8;
}
#goog-wm-qt:hover,
#goog-wm-qt:focus {
border-color: #105cb6;
outline: 0;
color: #222;
}
input::-moz-focus-inner {
padding: 0;
border: 0;
}
</style>
</head>
<body>
<div class="container">
<h1>Not found <span>:(</span></h1>
<p>Sorry, but the page you were trying to view does not exist.</p>
<p>It looks like this was the result of either:</p>
<ul>
<li>a mistyped address</li>
<li>an out-of-date link</li>
</ul>
<script>
var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),GOOG_FIXURL_SITE = location.host;
</script>
<script src="//linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
</div>
</body>
</html>
This diff is collapsed.
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css styles/vendor.css -->
<!-- bower:css -->
<!-- endbower -->
<!-- endbuild -->
<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->
</head>
<body ng-app="wusickApp">
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Add your site or application content here -->
<div class="container" ng-view=""></div>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXX-X');
ga('send', 'pageview');
</script>
<!--[if lt IE 9]>
<script src="bower_components/es5-shim/es5-shim.js"></script>
<script src="bower_components/json3/lib/json3.min.js"></script>
<![endif]-->
<!-- build:js scripts/vendor.js -->
<!-- bower:js -->
<!-- endbower -->
<!-- endbuild -->
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/app.js"></script>
<script src="scripts/controllers/main.js"></script>
<!-- endbuild -->
</body>
</html>
# robotstxt.org
User-agent: *
'use strict';
angular.module('wusickApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute',
'wusickControllers'
])
.config(function ($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
templateUrl: 'partials/main',
controller: 'MainCtrl'
})
.when('/message', {
templateUrl: 'partials/message',
controller: 'MessageCtrl'
})
.when('/login', {
templateUrl: 'partials/login',
controller: 'loginCtrl'
})
.when('/register', {
templateUrl: 'partials/register',
controller: 'registerCtrl'
})
.otherwise({
redirectTo: '/'
});
$locationProvider.html5Mode(true);
});
\ No newline at end of file
//creamos un módulo de angular para los controladores y le decimos que es un array
var wusickControllers = angular.module('wusickControllers', []);
//loginController
wusickControllers.controller('loginCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.userData = {};
//definimos la funcion
$scope.login = function(){
//le indicamos que hará una peticioón get a la funcion indicada y los datos que le pasamos
$http.post('/api/login', $scope.userData)
//definimos las acciones para cada respuesta, si es satisfactoria
.success(function(data) {
//y los datos null, es decir no existe cierto usuario
if(data==='null'){
console.log(data);
alert("Usuario o contraseña incorrectos");
}
else{
console.log(data);
alert("OK");
;
}
})
.error(function(data) {
console.log('Error: ' + data);
});
};
}]);
//register controler
wusickControllers.controller('registerCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.userData = {};
//definimos la funcion
$scope.register = function(){
//le indicamos que hará una peticioón get a la funcion indicada y los datos que le pasamos
$http.post('/api/register', $scope.userData)
//definimos las acciones para cada respuesta, si es satisfactoria
.success(function(data) {
//y los datos null, es decir no existe cierto usuario
if(data==='null'){
console.log(data);
alert("Usuario o contraseña incorrectos");
}
else{
console.log(data);
alert("OK");
;
}
})
.error(function(data) {
console.log('Error: ' + data);
});
};
}]);
\ No newline at end of file
var wusickControllers = angular.module('wusickControllers', []);
//loginController
wusickControllers.controller('loginCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.userData = {};
$scope.login = function(){
//Las peticiones desde el controlador indican la ruta a la base de datos.
$http.post('/api/login', $scope.userData)
.success(function(data) {
if(data==='null'){
console.log(data);
alert("Usuario o contraseña incorrectos");
}
else{
console.log(data);
alert("OK");
}
})
.error(function(data) {
console.log('Error: ' + data);
});
};
}]);
\ No newline at end of file
'use strict';
angular.module('wusickApp')
.controller('MainCtrl', function ($scope, $http) {
$http.get('/api/awesomeThings').success(function(awesomeThings) {
$scope.awesomeThings = awesomeThings;
});
});
'use strict';
angular.module('wusickApp')
.controller('MessageCtrl', function ($scope, $http) {
$http.get('/api/message').success(function(message) {
$scope.message = message;
});
});
'use strict';
angular.module('wusickApp')
.controller('NavbarCtrl', function ($scope, $location) {
$scope.menu = [{
'title': 'Home',
'link': '/'
}];
$scope.isActive = function(route) {
return route === $location.path();
};
});
/* Space out content a bit */
body {
padding-top: 20px;
padding-bottom: 20px;
}
/* Everything but the jumbotron gets side spacing for mobile first views */
.header,
.marketing,
.footer {
padding-left: 15px;
padding-right: 15px;
}
/* Custom page header */
.header {
border-bottom: 1px solid #e5e5e5;
}
/* Make the masthead heading the same height as the navigation */
.header h3 {
margin-top: 0;
margin-bottom: 0;
line-height: 40px;
padding-bottom: 19px;
}
/* Custom page footer */
.footer {
padding-top: 19px;
color: #777;
border-top: 1px solid #e5e5e5;
}
/* Customize container */
@media (min-width: 768px) {
.container {
max-width: 730px;
}
}
.container-narrow > hr {
margin: 30px 0;
}
/* Main marketing message and sign up button */
.jumbotron {
text-align: center;
border-bottom: 1px solid #e5e5e5;
}
.jumbotron .btn {
font-size: 21px;
padding: 14px 24px;
}
/* Supporting marketing content */
.marketing {
margin: 40px 0;
}
.marketing p + h4 {
margin-top: 28px;
}
/* Responsive: Portrait tablets and up */
@media screen and (min-width: 768px) {
/* Remove the padding we set earlier */
.header,
.marketing,
.footer {
padding-left: 0;
padding-right: 0;
}
/* Space out the masthead */
.header {
margin-bottom: 30px;
}
/* Remove the bottom border on the jumbotron for visual effect */
.jumbotron {
border-bottom: 0;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page Not Found :(</title>
<style>
::-moz-selection {
background: #b3d4fc;
text-shadow: none;
}
::selection {
background: #b3d4fc;
text-shadow: none;
}
html {
padding: 30px 10px;
font-size: 20px;
line-height: 1.4;
color: #737373;
background: #f0f0f0;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
html,
input {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
body {
max-width: 500px;
_width: 500px;
padding: 30px 20px 50px;
border: 1px solid #b3b3b3;
border-radius: 4px;
margin: 0 auto;
box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
background: #fcfcfc;
}
h1 {
margin: 0 10px;
font-size: 50px;
text-align: center;
}
h1 span {
color: #bbb;
}
h3 {
margin: 1.5em 0 0.5em;
}
p {
margin: 1em 0;
}
ul {
padding: 0 0 0 40px;
margin: 1em 0;
}
.container {
max-width: 380px;
_width: 380px;
margin: 0 auto;
}
/* google search */
#goog-fixurl ul {
list-style: none;
padding: 0;
margin: 0;
}
#goog-fixurl form {
margin: 0;
}
#goog-wm-qt,
#goog-wm-sb {
border: 1px solid #bbb;
font-size: 16px;
line-height: normal;
vertical-align: top;
color: #444;
border-radius: 2px;
}
#goog-wm-qt {
width: 220px;
height: 20px;
padding: 5px;
margin: 5px 10px 0 0;
box-shadow: inset 0 1px 1px #ccc;
}
#goog-wm-sb {
display: inline-block;
height: 32px;
padding: 0 10px;
margin: 5px 0 0;
white-space: nowrap;
cursor: pointer;
background-color: #f5f5f5;
background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1);
background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1);
background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1);
background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1);
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
*overflow: visible;
*display: inline;
*zoom: 1;
}
#goog-wm-sb:hover,
#goog-wm-sb:focus {
border-color: #aaa;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
background-color: #f8f8f8;
}
#goog-wm-qt:hover,
#goog-wm-qt:focus {
border-color: #105cb6;
outline: 0;
color: #222;
}
input::-moz-focus-inner {
padding: 0;
border: 0;
}
</style>
</head>
<body>
<div class="container">
<h1>Not found <span>:(</span></h1>
<p>Sorry, but the page you were trying to view does not exist.</p>
<p>It looks like this was the result of either:</p>
<ul>
<li>a mistyped address</li>
<li>an out-of-date link</li>
</ul>
<script>
var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),GOOG_FIXURL_SITE = location.host;
</script>
<script src="//linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
</div>
</body>
</html>
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<base href="/">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css(app) styles/vendor.css -->
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
<!-- endbower -->
<!-- endbuild -->
<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->
</head>
<body ng-app="wusickApp">
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Add your site or application content here -->
<div class="container" ng-view=""></div>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXX-X');
ga('send', 'pageview');
</script>
<!--[if lt IE 9]>
<script src="bower_components/es5-shim/es5-shim.js"></script>
<script src="bower_components/json3/lib/json3.min.js"></script>
<![endif]-->
<!-- build:js(app) scripts/vendor.js -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<!-- endbower -->
<!-- endbuild -->
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/app.js"></script>
<script src="scripts/controllers/main.js"></script>
<script src="scripts/controllers/navbar.js"></script>
<script src="scripts/controllers/message.js"></script>
<script src="scripts/controllers/login.js"></script>
<!-- endbuild -->
</body>
</html>
<div class="header">
<ul class="nav nav-pills pull-right">
<li class="active"><a ng-href="#">Home</a></li>
<li><a ng-href="#">About</a></li>
<li><a ng-href="#">Contact</a></li>
</ul>
<h3 class="text-muted">wusick</h3>
</div>
<div class="jumbotron">
<h1>'Allo, 'Allo!</h1>
<p class="lead">
<img src="images/yeoman.png" alt="I'm Yeoman"><br>
Always a pleasure scaffolding your apps.
</p>
<p><a class="btn btn-lg btn-success" ng-href="#">Splendid!<span class="glyphicon glyphicon-ok"></span></a></p>
</div>
<div class="row marketing">
<h4>HTML5 Boilerplate</h4>
<p>
HTML5 Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites.
</p>
<h4>Angular</h4>
<p>
AngularJS is a toolset for building the framework most suited to your application development.
</p>
<h4>Karma</h4>
<p>Spectacular Test Runner for JavaScript.</p>
</div>
<div class="footer">
<p><span class="glyphicon glyphicon-heart"></span> from the Yeoman team</p>
</div>
<p>This is the login view.</p>
<div id="logo"></div>
<div class="col-xs-12">
<form id="login">
<div>
<label></label>
<input type="text" placeholder="Usuario" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Usuario'" ng-model="userData.nombre" id="nombre"/>
</div>
<div class="clearfix"></div>
<div>
<label></label>
<input type="password" placeholder="Contraseña" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Contraseña'" ng-model="userData.pass" id="pass"/>
</div>
<div class="clearfix"></div>
<button type="submit" value="Log in" ng-click="login()">Log in</button>
<small><a href="">Olvidaste tu contraseña?</a></small>
<small><a href="/register">Crear una cuenta</a></small>
</form>
</div>
<div ng-include="'partials/navbar'"></div>
<div class="jumbotron">
<h1>'Allo, 'Allo!</h1>
<p class="lead">
<img src="images/yeoman.png" alt="I'm Yeoman"><br>
Always a pleasure scaffolding your apps.
</p>
<p><a class="btn btn-lg btn-success" ng-href="#">Splendid!</a></p>
</div>
<div class="row marketing">
<div ng-repeat="thing in awesomeThings">
<h4>{{thing.name}}</h4>
<p>{{thing.info}}</p>
</div>
</div>
<div class="footer">
<p>♥ from the Yeoman team</p>
</div>
<p>This is the message view.</p>
The message of the day is {{ message }}
\ No newline at end of file
<div class="header" ng-controller="NavbarCtrl">
<ul class="nav nav-pills pull-right">
<li ng-repeat="item in menu" ng-class="{active: isActive(item.link)}">
<a ng-href="{{item.link}}">{{item.title}}</a>
</li>
</ul>
<h3 class="text-muted">wusick</h3>
</div>
\ No newline at end of file
<p>This is the register view.</p>
<div class="col-xs-12">
<form id="register">
<div>
<label></label>
<input type="text" placeholder="Usuario" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Usuario'" ng-model="userData.nombre" id="nombre"/>
</div>
<div>
<label></label>
<input type="password" placeholder="Contraseña" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Contraseña'" ng-model="userData.pass" id="pass"/>
</div>
<div>
<label></label>
<input type="email" placeholder="Email" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Email'" ng-model="userData.email" id="pass"/>
</div>
<div>
<label></label>
<input type="hidden" ng-model="userData.tipo" id="tipo" value=1/>
</div>
<button type="submit" value="registrarse" ng-click="register()">Registrarse</button>
</form>
</div>
\ No newline at end of file
{
"name": "wusick",
"version": "0.0.0",
"dependencies": {
"angular": ">=1.2.*",
"json3": "~3.2.6",
"es5-shim": "~2.1.0",
"jquery": "~1.11.0",
"bootstrap": "~3.1.1",
"angular-resource": ">=1.2.*",
"angular-cookies": ">=1.2.*",
"angular-sanitize": ">=1.2.*",
"angular-route": ">=1.2.*"
},
"devDependencies": {
"angular-mocks": ">=1.2.*",
"angular-scenario": ">=1.2.*"
},
"testPath": "test/client/spec"
}
// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['ng-scenario'],
// list of files / patterns to load in the browser
files: [
'test/client/e2e/**/*.js'
],
// list of files / patterns to exclude
exclude: [],
// web server port
port: 8080,
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Chrome'],
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
// Uncomment the following lines if you are using grunt's server to run the tests
// proxies: {
// '/': 'http://localhost:9000/'
// },
// URL root prevent conflicts with the site root
// urlRoot: '_karma_'
});
};
// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'app/bower_components/angular/angular.js',
'app/bower_components/angular-mocks/angular-mocks.js',
'app/bower_components/angular-resource/angular-resource.js',
'app/bower_components/angular-cookies/angular-cookies.js',
'app/bower_components/angular-sanitize/angular-sanitize.js',
'app/bower_components/angular-route/angular-route.js',
'app/scripts/*.js',
'app/scripts/**/*.js',
'test/client/mock/**/*.js',
'test/client/spec/**/*.js'
],
// list of files / patterns to exclude
exclude: [],
// web server port
port: 8080,
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Chrome'],
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
});
};
{
"node": true,
"esnext": true,
"bitwise": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"regexp": true,
"undef": true,
"smarttabs": true
}
\ No newline at end of file
'use strict';
var _ = require('lodash');
/**
* Load environment configuration
*/
module.exports = _.merge(
require('./env/all.js'),
require('./env/' + process.env.NODE_ENV + '.js') || {});
\ No newline at end of file
'use strict';
var path = require('path');
var rootPath = path.normalize(__dirname + '/../../..');
module.exports = {
root: rootPath,
port: process.env.PORT || 9000
};
\ No newline at end of file
'use strict';
module.exports = {
env: 'development'
};
\ No newline at end of file
'use strict';
module.exports = {
env: 'production',
ip: process.env.OPENSHIFT_NODEJS_IP ||
process.env.IP ||
'0.0.0.0',
port: process.env.OPENSHIFT_NODEJS_PORT ||
process.env.PORT ||
8080
};
\ No newline at end of file
'use strict';
module.exports = {
env: 'test'
};
\ No newline at end of file
'use strict';
var express = require('express'),
favicon = require('static-favicon'),
morgan = require('morgan'),
compression = require('compression'),
bodyParser = require('body-parser'),
methodOverride = require('method-override'),
cookieParser = require('cookie-parser'),
session = require('express-session'),
errorHandler = require('errorhandler'),
path = require('path'),
config = require('./config');
/**
* Express configuration
*/
module.exports = function(app) {
var env = app.get('env');
if ('development' === env) {
app.use(require('connect-livereload')());
// Disable caching of scripts for easier testing
app.use(function noCache(req, res, next) {
if (req.url.indexOf('/scripts/') === 0) {
res.header('Cache-Control', 'no-cache, no-store, must-revalidate');
res.header('Pragma', 'no-cache');
res.header('Expires', 0);
}
next();
});
app.use(express.static(path.join(config.root, '.tmp')));
app.use(express.static(path.join(config.root, 'app')));
app.set('views', config.root + '/app/views');
}
if ('production' === env) {
app.use(compression());
app.use(favicon(path.join(config.root, 'public', 'favicon.ico')));
app.use(express.static(path.join(config.root, 'public')));
app.set('views', config.root + '/views');
}
app.engine('html', require('ejs').renderFile);
app.set('view engine', 'html');
app.use(morgan('dev'));
app.use(bodyParser());
app.use(methodOverride());
// Error handler - has to be last
if ('development' === app.get('env')) {
app.use(errorHandler());
}
};
\ No newline at end of file
'use strict';
var connection = require('dbfunct/MySQLconnection');
/**
* Get awesome things
*/
exports.awesomeThings = function(req, res) {
res.json([
{
name : 'HTML5 Boilerplate',
info : 'HTML5 Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites.',
awesomeness: 10
}, {
name : 'AngularJS',
info : 'AngularJS is a toolset for building the framework most suited to your application development.',
awesomeness: 10
}, {
name : 'Karma',
info : 'Spectacular Test Runner for JavaScript.',
awesomeness: 10
}, {
name : 'Express',
info : 'Flexible and minimalist web application framework for node.js.',
awesomeness: 10
}
]);
};
exports.message = function(req, res) {
res.send('Hello World');
};
//login function
exports.login = function (req,res,callback) {
var user = req.body.nombre;
var pass = req.body.pass;
var json ="";
//creating connection object
var sqlconnection = connection.createConnection();
var query = 'SELECT * FROM usuarios WHERE nombre="'+user+'" AND password="'+pass+'"';
//sending query through our connection object
sqlconnection.query(query, function(err, results) {
if (err)
return callback(err, "query error");
if (results.length<=0){
console.log("login incorrecto"+results);
res.send('null');
}else{
console.log("login correcto del usuario: "+user);
json = JSON.stringify(results);
//returning jsonized result
//res.json(json);
//returning json object
res.json(results);
}
sqlconnection.end();
});
};
//register function
exports.register = function (req,res,callback) {
var mail = req.body.mail;
if(verificaMail(mail)){
console.log("existe");
res.send("email existe - no registrar")
}else{
console.log("no existe");
res.send ("email no existe registrar")
}
/*
var user = req.body.nombre;
var pass = req.body.pass;
var json ="";
//creating connection object
var sqlconnection = connection.createConnection();
var query = 'SELECT * FROM usuarios WHERE nombre="'+user+'" AND password="'+pass+'"';
//sending query through our connection object
sqlconnection.query(query, function(err, results) {
if (err)
return callback(err, "query error");
if (results.length<=0){
console.log("login incorrecto"+results);
res.send('null');
}else{
console.log("login correcto del usuario: "+user);
json = JSON.stringify(results);
//returning jsonized result
//res.json(json);
//returning json object
res.json(results);
}
sqlconnection.end();
});*/
};
var verificaMail = function (mail) {
//creating connection object
var sqlconnection = connection.createConnection();
var query = 'SELECT * FROM usuarios WHERE email="'+mail+'';
//sending query through our connection object
sqlconnection.query(query, function(err, results) {
if (err)
return callback(err, "query error");
if (results.length<=0){
return false;
//res.send('null');
}else{
return true;
}
sqlconnection.end();
});
};
'use strict';
var path = require('path');
/**
* Send partial, or 404 if it doesn't exist
*/
exports.partials = function(req, res) {
var stripped = req.url.split('.')[0];
var requestedView = path.join('./', stripped);
res.render(requestedView, function(err, html) {
if(err) {
console.log("Error rendering partial '" + requestedView + "'\n", err);
res.status(404);
res.send(404);
} else {
res.send(html);
}
});
};
/**
* Send our single page app
*/
exports.index = function(req, res) {
res.render('index');
};
'use strict';
var api = require('./controllers/api'),
index = require('./controllers');
/**
* Application routes
*/
module.exports = function(app) {
// Server API Routes
app.route('/api/awesomeThings')
.get(api.awesomeThings);
app.route('/api/message')
.get(api.message);
app.route('/api/login')
.post(api.login);
app.route('/api/register')
.post(api.register);
// All undefined api routes should return a 404
app.route('/api/*')
.get(function(req, res) {
res.send(404);
});
// All other routes to use Angular routing in app/scripts/app.js
app.route('/partials/*')
.get(index.partials);
app.route('/*')
.get( index.index);
};
\ No newline at end of file
{
"name": "wusick",
"version": "0.0.0",
"dependencies": {
"express": "~4.0.0",
"morgan": "~1.0.0",
"body-parser": "~1.0.0",
"method-override": "~1.0.0",
"static-favicon": "~1.0.1",
"cookie-parser": "~1.0.1",
"express-session": "~1.0.2",
"errorhandler": "~1.0.0",
"compression": "~1.0.1",
"lodash": "~2.4.1",
"ejs": "~0.8.4"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-autoprefixer": "~0.4.0",
"grunt-bower-install": "~0.7.0",
"grunt-concurrent": "~0.4.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-compass": "~0.6.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-htmlmin": "~0.1.3",
"grunt-contrib-imagemin": "~0.5.0",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-watch": "~0.5.2",
"grunt-google-cdn": "~0.2.0",
"grunt-newer": "~0.5.4",
"grunt-ngmin": "~0.0.2",
"grunt-rev": "~0.1.0",
"grunt-svgmin": "~0.2.0",
"grunt-usemin": "~2.0.0",
"jshint-stylish": "~0.1.3",
"load-grunt-tasks": "~0.2.0",
"time-grunt": "~0.2.1",
"grunt-express-server": "~0.4.5",
"grunt-open": "~0.2.0",
"connect-livereload": "~0.3.0",
"karma-ng-scenario": "~0.1.0",
"grunt-karma": "~0.6.2",
"karma-firefox-launcher": "~0.1.3",
"karma-script-launcher": "~0.1.0",
"karma-html2js-preprocessor": "~0.1.0",
"karma-jasmine": "~0.1.5",
"karma-chrome-launcher": "~0.1.2",
"requirejs": "~2.1.10",
"karma-requirejs": "~0.2.1",
"karma-coffee-preprocessor": "~0.1.2",
"karma-phantomjs-launcher": "~0.1.1",
"karma": "~0.10.9",
"karma-ng-html2js-preprocessor": "~0.1.0",
"grunt-mocha-test": "~0.8.1",
"supertest": "~0.8.2",
"should": "~2.1.0",
"grunt-env": "~0.4.1",
"grunt-node-inspector": "~0.1.3",
"grunt-nodemon": "~0.2.0",
"open": "~0.0.4"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "grunt test"
}
}
\ No newline at end of file
'use strict';
var express = require('express');
/**
* Main application file
*/
// Set default node environment to development
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
var config = require('./lib/config/config');
// Setup Express
var app = express();
require('./lib/config/express')(app);
require('./lib/routes')(app);
// Start server
app.listen(config.port, config.ip, function () {
console.log('Express server listening on %s:%d, in %s mode', config.ip, config.port, app.get('env'));
});
// Expose app
exports = module.exports = app;
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"globals": {
"after": false,
"afterEach": false,
"angular": false,
"before": false,
"beforeEach": false,
"browser": false,
"describe": false,
"expect": false,
"inject": false,
"it": false,
"jasmine": false,
"spyOn": false
}
}
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"globals": {
"after": false,
"afterEach": false,
"angular": false,
"before": false,
"beforeEach": false,
"browser": false,
"describe": false,
"expect": false,
"inject": false,
"it": false,
"jasmine": false,
"spyOn": false
}
}
<!doctype html>
<html lang="en">
<head>
<title>End2end Test Runner</title>
<script src="vendor/angular-scenario.js" ng-autotest></script>
<script src="scenarios.js"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
'use strict';
describe('Controller: LoginCtrl', function () {
// load the controller's module
beforeEach(module('wusickApp'));
var LoginCtrl,
scope,
$httpBackend;
// Initialize the controller and a mock scope
beforeEach(inject(function (_$httpBackend_, $controller, $rootScope) {
$httpBackend = _$httpBackend_;
$httpBackend.expectGET('/api/awesomeThings')
.respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']);
scope = $rootScope.$new();
LoginCtrl = $controller('LoginCtrl', {
$scope: scope
});
}));
it('should attach a list of awesomeThings to the scope', function () {
expect(scope.awesomeThings).toBeUndefined();
$httpBackend.flush();
expect(scope.awesomeThings.length).toBe(4);
});
});
'use strict';
describe('Controller: MainCtrl', function () {
// load the controller's module
beforeEach(module('wusickApp'));
var MainCtrl,
scope,
$httpBackend;
// Initialize the controller and a mock scope
beforeEach(inject(function (_$httpBackend_, $controller, $rootScope) {
$httpBackend = _$httpBackend_;
$httpBackend.expectGET('/api/awesomeThings')
.respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']);
scope = $rootScope.$new();
MainCtrl = $controller('MainCtrl', {
$scope: scope
});
}));
it('should attach a list of awesomeThings to the scope', function () {
expect(scope.awesomeThings).toBeUndefined();
$httpBackend.flush();
expect(scope.awesomeThings.length).toBe(4);
});
});
'use strict';
describe('Controller: MessageCtrl', function () {
// load the controller's module
beforeEach(module('wusickApp'));
var MessageCtrl,
scope,
$httpBackend;
// Initialize the controller and a mock scope
beforeEach(inject(function (_$httpBackend_, $controller, $rootScope) {
$httpBackend = _$httpBackend_;
$httpBackend.expectGET('/api/awesomeThings')
.respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']);
scope = $rootScope.$new();
MessageCtrl = $controller('MessageCtrl', {
$scope: scope
});
}));
it('should attach a list of awesomeThings to the scope', function () {
expect(scope.awesomeThings).toBeUndefined();
$httpBackend.flush();
expect(scope.awesomeThings.length).toBe(4);
});
});
<!doctype html>
<html lang="en">
<head>
<title>End2end Test Runner</title>
<script src="vendor/angular-scenario.js" ng-autotest></script>
<script src="scenarios.js"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
'use strict';
var should = require('should'),
app = require('../../../server'),
request = require('supertest');
describe('GET /api/awesomeThings', function() {
it('should respond with JSON array', function(done) {
request(app)
.get('/api/awesomeThings')
.expect(200)
.expect('Content-Type', /json/)
.end(function(err, res) {
if (err) return done(err);
res.body.should.be.instanceof(Array);
done();
});
});
});
\ No newline at end of file
'use strict';
describe('Controller: MainCtrl', function () {
// load the controller's module
beforeEach(module('wusickApp'));
var MainCtrl,
scope,
$httpBackend;
// Initialize the controller and a mock scope
beforeEach(inject(function (_$httpBackend_, $controller, $rootScope) {
$httpBackend = _$httpBackend_;
$httpBackend.expectGET('/api/awesomeThings')
.respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']);
scope = $rootScope.$new();
MainCtrl = $controller('MainCtrl', {
$scope: scope
});
}));
it('should attach a list of awesomeThings to the scope', function () {
expect(scope.awesomeThings).toBeUndefined();
$httpBackend.flush();
expect(scope.awesomeThings.length).toBe(4);
});
});
<configuration>
<system.webServer>
<handlers>
<!-- indica que el archivo app.js es una aplicación node.js controlada por el módulo iisnode -->
<add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<!-- No interfiera con las solicitudes de depuración del inspector de nodos -->
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^server.js\/debug[\/]?" />
</rule>
<!--En primer lugar, tenemos en cuenta si la URL entrante coincide con un archivo físico en la carpeta /public -->
<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}" />
</rule>
<!-- Cualquier otra URL está asignada al punto de entrada de la aplicación Node.js -->
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True" />
</conditions>
<action type="Rewrite" url="server.js" />
</rule>
</rules>
</rewrite>
<!-- Puede controlar cómo se hospeda el nodo en IIS utilizando las siguientes opciones -->
<!--<iisnode
node_env="%node_env%"
nodeProcessCountPerApplication="1"
maxConcurrentRequestsPerProcess="1024"
maxNamedPipeConnectionRetry="3"
namedPipeConnectionRetryDelay="2000"
maxNamedPipeConnectionPoolSize="512"
maxNamedPipePooledConnectionAge="30000"
asyncCompletionThreadCount="0"
initialRequestBufferSize="4096"
maxRequestBufferSize="65536"
watchedFiles="*.js"
uncFileChangesPollingInterval="5000"
gracefulShutdownTimeout="60000"
loggingEnabled="true"
logDirectoryNameSuffix="logs"
debuggingEnabled="true"
debuggerPortRange="5058-6058"
debuggerPathSegment="debug"
maxLogFileSizeInKB="128"
appendToExistingLog="false"
logFileFlushInterval="5000"
devErrorsEnabled="true"
flushResponse="false"
enableXFF="false"
promoteServerVars=""
/>-->
</system.webServer>
</configuration>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment