Merge branch 'master' of github.com:whitef0x0/medforms
This commit is contained in:
commit
e480df05c4
|
@ -3,7 +3,9 @@
|
||||||
/**
|
/**
|
||||||
* Module dependencies.
|
* Module dependencies.
|
||||||
*/
|
*/
|
||||||
exports.index = function(req, res) {
|
exports.index = function(req, res, next) {
|
||||||
|
// res.send('Hello World');
|
||||||
|
next(new Error("Bump!"));
|
||||||
res.render('index', {
|
res.render('index', {
|
||||||
user: req.user || null,
|
user: req.user || null,
|
||||||
request: req
|
request: req
|
||||||
|
|
|
@ -84,6 +84,17 @@
|
||||||
<script type="text/javascript" src="http://{{request.hostname}}:35729/livereload.js"></script>
|
<script type="text/javascript" src="http://{{request.hostname}}:35729/livereload.js"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
Raven.config('http://db01e03015ce48e2b68240ea8254b17c@sentry.polydaic.com/1', {
|
||||||
|
// Raven settings
|
||||||
|
})
|
||||||
|
.setUser({
|
||||||
|
"id": "SERVER_RENDERED_ID",
|
||||||
|
"email": "SERVER_RENDERED_EMAIL"
|
||||||
|
})
|
||||||
|
.install()
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- [if lt IE 9]>
|
<!-- [if lt IE 9]>
|
||||||
<section class="browsehappy jumbotron hide">
|
<section class="browsehappy jumbotron hide">
|
||||||
<h1>Hello there!</h1>
|
<h1>Hello there!</h1>
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
"angular-permission": "~0.3.0",
|
"angular-permission": "~0.3.0",
|
||||||
"restangular": "~1.5.1",
|
"restangular": "~1.5.1",
|
||||||
"fontawesome": "~4.3.0",
|
"fontawesome": "~4.3.0",
|
||||||
"ng-file-upload": "~5.0.9"
|
"ng-file-upload": "~5.0.9",
|
||||||
|
"angular-raven": "~0.5.11"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"angular": "^1.2.21",
|
"angular": "^1.2.21",
|
||||||
|
|
2
config/env/all.js
vendored
2
config/env/all.js
vendored
|
@ -10,7 +10,7 @@ module.exports = {
|
||||||
templateEngine: 'swig',
|
templateEngine: 'swig',
|
||||||
|
|
||||||
//Sentry DSN Client Key
|
//Sentry DSN Client Key
|
||||||
DSN: 'http://db01e03015ce48e2b68240ea8254b17c:5d878e9bb6c6488fbb70fb81295ee700@sentry.example.com/1',
|
DSN: 'http://db01e03015ce48e2b68240ea8254b17c:5d878e9bb6c6488fbb70fb81295ee700@sentry.polydaic.com/1',
|
||||||
|
|
||||||
// The secret should be set to a non-guessable string that
|
// The secret should be set to a non-guessable string that
|
||||||
// is used to compute a session hash
|
// is used to compute a session hash
|
||||||
|
|
|
@ -74,12 +74,6 @@ module.exports = function(db) {
|
||||||
// Showing stack errors
|
// Showing stack errors
|
||||||
app.set('showStackError', true);
|
app.set('showStackError', true);
|
||||||
|
|
||||||
// Sentry (Raven) error reporting
|
|
||||||
app.use(raven.middleware.express.requestHandler(config.DSN));
|
|
||||||
|
|
||||||
// Should come before any other error middleware
|
|
||||||
app.use(raven.middleware.express.errorHandler(config.DSN));
|
|
||||||
// app.use(onError); // optional error handler if you want to display the error id to a user
|
|
||||||
|
|
||||||
// Set swig as the template engine
|
// Set swig as the template engine
|
||||||
app.engine('server.view.html', consolidate[config.templateEngine]);
|
app.engine('server.view.html', consolidate[config.templateEngine]);
|
||||||
|
@ -180,6 +174,27 @@ module.exports = function(db) {
|
||||||
require(path.resolve(routePath))(app);
|
require(path.resolve(routePath))(app);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add headers
|
||||||
|
// app.use(function (req, res, next) {
|
||||||
|
|
||||||
|
// // Website you wish to allow to connect
|
||||||
|
// res.setHeader('Access-Control-Allow-Origin', 'http://sentry.polydaic.com');
|
||||||
|
|
||||||
|
// // Request methods you wish to allow
|
||||||
|
// res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
|
||||||
|
|
||||||
|
// // Request headers you wish to allow
|
||||||
|
// res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
|
||||||
|
|
||||||
|
// // Set to true if you need the website to include cookies in the requests sent
|
||||||
|
// // to the API (e.g. in case you use sessions)
|
||||||
|
// res.setHeader('Access-Control-Allow-Credentials', true);
|
||||||
|
|
||||||
|
// // Pass to next layer of middleware
|
||||||
|
// next();
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
// Assume 'not found' in the error msgs is a 404. this is somewhat silly, but valid, you can do whatever you like, set properties, use instanceof etc.
|
// Assume 'not found' in the error msgs is a 404. this is somewhat silly, but valid, you can do whatever you like, set properties, use instanceof etc.
|
||||||
app.use(function(err, req, res, next) {
|
app.use(function(err, req, res, next) {
|
||||||
// If the error object doesn't exists
|
// If the error object doesn't exists
|
||||||
|
@ -202,6 +217,17 @@ module.exports = function(db) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Sentry (Raven) middleware
|
||||||
|
app.use(raven.middleware.express(config.DSN));
|
||||||
|
|
||||||
|
raven.patchGlobal(function(logged, err) {
|
||||||
|
console.error(err)
|
||||||
|
console.error(err.stack)
|
||||||
|
|
||||||
|
console.error('exiting process (after global patch)')
|
||||||
|
process.exit(1)
|
||||||
|
})
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'secure') {
|
if (process.env.NODE_ENV === 'secure') {
|
||||||
// Load SSL key and certificate
|
// Load SSL key and certificate
|
||||||
var privateKey = fs.readFileSync('./config/sslcerts/key.pem', 'utf8');
|
var privateKey = fs.readFileSync('./config/sslcerts/key.pem', 'utf8');
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
console.log('hi');
|
||||||
|
|
||||||
//Start by defining the main module and adding the module dependencies
|
//Start by defining the main module and adding the module dependencies
|
||||||
angular.module(ApplicationConfiguration.applicationModuleName, ApplicationConfiguration.applicationModuleVendorDependencies);
|
angular.module(ApplicationConfiguration.applicationModuleName, ApplicationConfiguration.applicationModuleVendorDependencies);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
var ApplicationConfiguration = (function() {
|
var ApplicationConfiguration = (function() {
|
||||||
// Init module configuration options
|
// Init module configuration options
|
||||||
var applicationModuleName = 'medform';
|
var applicationModuleName = 'medform';
|
||||||
var applicationModuleVendorDependencies = ['ngResource', 'ngAnimate', 'ui.router', 'ui.bootstrap', 'ui.utils'];
|
var applicationModuleVendorDependencies = ['ngResource', 'ngAnimate', 'ui.router', 'ui.bootstrap', 'ui.utils', 'ngRaven'];
|
||||||
|
|
||||||
// Add a new vertical module
|
// Add a new vertical module
|
||||||
var registerModule = function(moduleName, dependencies) {
|
var registerModule = function(moduleName, dependencies) {
|
||||||
|
|
Loading…
Reference in a new issue