Skip to content

Commit

Permalink
updated server
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniespratley committed Jan 11, 2015
1 parent 96c5746 commit 5a66568
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
26 changes: 26 additions & 0 deletions npm-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 error [email protected] start: `node server.js`
9 error Exit status 8
10 error Failed at the [email protected] start script.
10 error This is most likely a problem with the angular-cms package,
10 error not with npm itself.
10 error Tell the author that this fails on your system:
10 error node server.js
10 error You can get their info via:
10 error npm owner ls angular-cms
10 error There is likely additional logging output above.
11 error System Darwin 14.0.0
12 error command "node" "/usr/local/bin/npm" "start"
13 error cwd /WWW/Learning_Yeoman/angular-cms
14 error node -v v0.10.30
15 error npm -v 1.4.21
16 error code ELIFECYCLE
17 verbose exit [ 1, true ]
35 changes: 35 additions & 0 deletions routes/cms-db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
var mongoose = require('mongoose');

module.exports = function(config) {
console.warn('cms-db initialized');
try {
mongoose.connect(config.db.url);
} catch (err) {
throw new Error('Unable to connect to MongoDB at ' + config.db.url);
}

// CONNECTION EVENTS
// When successfully connected
mongoose.connection.on('connected', function() {
console.log('Mongoose default connection open to ', config.db.url);
});

// If the connection throws an error
mongoose.connection.on('error', function(err) {
console.log('Mongoose default connection error: ' + err);
});

// When the connection is disconnected
mongoose.connection.on('disconnected', function() {
console.log('Mongoose default connection disconnected');
});

// If the Node process ends, close the Mongoose connection
process.on('SIGINT', function() {
mongoose.connection.close(function() {
console.log('Mongoose default connection disconnected through app termination');
process.exit(0);
});
});

};
43 changes: 43 additions & 0 deletions www/register.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

<% layout('layout') -%>
<div class="col-sm-12">
<div class="slim-view register">
<form id="register-form" class="form-register well well-sm" name="RegisterForm" method="post" action="/register">
<header class="img-logo center avatar">
<img class="img-circle"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAIAAADdvvtQAAAIWklEQVR42uyda3PaSBBF9f//YuIAtnjJSOYhzCPYyim6ULGxdzexDUy37v3gwhhwlXTovj3TM5P1JOkTynQJJAEkCSBJAEkCSJIEkCSAJAEkCSBJEkCSAJIEkCSAJEkASQJIEkCSAJIkASQJIEkASQJIEkCSJIAkASQJIEkASZIAkgSQJIAkASRJAkgSQJIASlg/jro76ftJd2fiBbpQAugfAotvR/Gg3+8PBoOHo/I8Hw6H/LRf7+/v+SsAgRQv5qdg6jRA3H7jADImk0lZlovF4vn5eb/fHw6H19fX5iQe8wzPbzab5XJZVdV0OgUs+wSwE0Dd4saSEdwATV3XkNH8vUAK2ubz+Xg8bj+zgzGpQwCZreEB8QNuIKD5ChGfttstLEJk+y8EUDS16JCGmssIIp+ennBL5LXuhKKsI4EHl3M5dH7DCJPUIiuAfNsd7iIhYbVaNdfVbrfDG5kxEkCOA8/j4+NXeZ0PCItN5R87FGVR6SH8UJY3txb+moIfVySAPNEzGAyosZs0RAgknUUdeIwGkJkeLEiTkij1SaYhGcqC0XN/f58aPa1CMpQFo+djw8pXU1EUwRgKApDNg+JYm7RFLjM/JIDSGu8BoOsP9nzYU+PSwjAUASBuRlmWjR8RKS1qCqAk6BmNRufdFy40n89jmCHfAFkPYfrW513BfYABxsx7+JnNZo1PWSLzHoQcA2RNYTec6vq8oN+7m/YKkLWTpjDb9Rnt93vvQcgrQDZl8fLy0jgXQci1E3IMUFVVjX/tdrt+v++3pHcJkM23//z5swmh6XTqNwh5BYiL3kRRXdd+V3R4BYiLHgYgnBx+zmkWcwkQ+ct19f5up4cAUv76VBZzOiDkDyD85nw+DwYQBYFM9PUiUDr9zl9og4bD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ZL1e2hZT+rBhgcQM51OuYUEFQLGbdcZEregFnaJdvBE/AtGUuYdGssRfNGBhvtEfkl2dTMoAzRYl2UJTL1jW5L3thCXALU9XFgZchNZw91Gd8BEcIJ40qs1phGZdNjKxUOOoUOSghtSQ4x9orFlkIRnsgTnC6PMBTeGDo/JU1RMwQ7KaEWCo7Jr13W4yGtZ+iGHS0nIueiKnNSyG0mZgGTJOvGAlC5Alq34OvKlTHbHlksHJGo3HFLKaxSzZAMPUQdnEPJ41L91SFRtbRIXQP+PDt+5qqqiGp0PjycVRZEgRllSOYt8T9DuiNf5gOq6Tm3VfZYOPVyaFHb0Sd9iz2azX+3dMY6EMBAEQP//m2ARIJEQkd1IhBedtNs2XPUPEIXHsyyeeT6/Hw/ofgVR67Oa9deTh2YoZ224nnqY3jH5K3/22T0sYWw5a2PL1iQH0T00M5y+2AbqqW7roXNSpko1+QMNtVGVq7bMuq1P5TiOUYbaqMo1zzG870h1IUNm17X82vOgwSjPau977/m+LAroTdOW53zpkR8A3cLFa9s2d/p7uefYvXkF+uzplvK7sV/XNbkIteTyUxs99/jbOc8zuQi12NpTj4XlJ7ObXpYlZigEqDpMu59Y9n2PtfQtVr80X8kqFvscNgHoPo7Zbz+xXNcVmxIUAlTXM/k005f1YrUNehWguh7/bk6mmvnMPrplNkC9dzc1mdhrDYAAAkgAEoAAAggggAASgAQggAACCCCAAAJIAAIIIIAAAggggAQgAQgggAACCCABSAACCCCAAAJIABKAAAIIIIAAAgggAQgggAACCCCAABKABCCAAAIIIIAEIAEIIIAAAgggAUgAAui/AfoBf2hGKefNUEoAAAAASUVORK5CYII="/>
</header>
<div class="message">

</div>
<div class="form-group">
<input id="email" name="email" type="email" class="form-control" placeholder="Email" ng-model="user.email" required/>
</div>
<div class="form-group">
<input id="username" name="username" type="text" class="form-control" placeholder="Username" ng-model="user.username"/>
</div>
<div class="form-group">
<input id="password" name="password" type="password" class="form-control" placeholder="Password" ng-model="user.password" required/>
</div>
<div class="form-group">
<input id="password2" name="password2" type="password" class="form-control" placeholder="Confirm Password" ng-model="user.password2"
required/>
</div>
<div class="form-group">
<label>
<input id="agree" name="agree" class="inline-checkbox" type="checkbox" ng-model="user.agree" required>
Agree to Terms of Use
</label>
</div>
<div class="form-group">
<button class="btn btn-primary btn-block" type="submit" ng-disabled="!RegisterForm.$valid" ng-click="register(user)">
Sign up
</button>
</div>
</form>
<div class="clearfix">
<span class="pull-left"> Back to <a href="/login">Login</a> </span>
</div>
</div>

</div>

0 comments on commit 5a66568

Please sign in to comment.