forked from linnovate/mean
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace jshint task with standard task in gulp dev formatted all files wrt standard linter fixed lint warnings regarding path and split vars fixed lint warnings around error handling fixed other misc lint warnings
- Loading branch information
1 parent
dbb39c5
commit 36e50c1
Showing
29 changed files
with
608 additions
and
597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
import 'angular/angular-csp.css'; | ||
import 'angular-ui-select/select.min.css'; | ||
import 'bootstrap/dist/css/bootstrap.min.css'; | ||
import 'angular/angular-csp.css' | ||
import 'angular-ui-select/select.min.css' | ||
import 'bootstrap/dist/css/bootstrap.min.css' | ||
|
||
import jQuery from 'jquery'; | ||
import 'angular'; | ||
import 'angular-ui-select/select'; | ||
import 'angular-mocks'; | ||
import 'angular-cookies'; | ||
import 'angular-resource'; | ||
import 'angular-sanitize'; | ||
import 'angular-ui-router'; | ||
import 'angular-jwt'; | ||
import 'angular-bootstrap/ui-bootstrap-tpls'; | ||
import jQuery from 'jquery' | ||
import 'angular' | ||
import 'angular-ui-select/select' | ||
import 'angular-mocks' | ||
import 'angular-cookies' | ||
import 'angular-resource' | ||
import 'angular-sanitize' | ||
import 'angular-ui-router' | ||
import 'angular-jwt' | ||
import 'angular-bootstrap/ui-bootstrap-tpls' | ||
|
||
window.$ = jQuery; | ||
window.$ = jQuery | ||
|
||
angular.element(document).ready(function () { | ||
//Fixing facebook bug with redirect | ||
if (window.location.hash === '#_=_') window.location.hash = '#!'; | ||
|
||
//Then init the app | ||
angular.bootstrap(document, ['mean']); | ||
|
||
}); | ||
|
||
function processModules(modules) { | ||
|
||
var packageModules = ['ngCookies', 'ngResource', 'ui.bootstrap', 'ui.router', 'ui.select', 'ngSanitize'], m, mn; | ||
for (var index in modules) { | ||
m = modules[index]; | ||
mn = 'mean.' + m.name; | ||
angular.module(mn, m.angularDependencies || []); | ||
packageModules.push(mn); | ||
} | ||
|
||
var req = require.context('./packages', true, /\/public\/(?!tests|assets|views)(.*)\.js$/); | ||
req.keys().map(req); | ||
req = require.context('./node_modules', true, /\/meanio-(.*)\/public\/(?!tests|assets|views)(.*)\.js$/); | ||
req.keys().map(req); | ||
angular.module('mean', packageModules); | ||
// Fixing facebook bug with redirect | ||
if (window.location.hash === '#_=_') window.location.hash = '#!' | ||
|
||
// Then init the app | ||
angular.bootstrap(document, ['mean']) | ||
}) | ||
|
||
function processModules (modules) { | ||
var packageModules = ['ngCookies', 'ngResource', 'ui.bootstrap', 'ui.router', 'ui.select', 'ngSanitize'] | ||
var m | ||
var mn | ||
for (var index in modules) { | ||
m = modules[index] | ||
mn = 'mean.' + m.name | ||
angular.module(mn, m.angularDependencies || []) | ||
packageModules.push(mn) | ||
} | ||
|
||
var req = require.context('./packages', true, /\/public\/(?!tests|assets|views)(.*)\.js$/) | ||
req.keys().map(req) | ||
req = require.context('./node_modules', true, /\/meanio-(.*)\/public\/(?!tests|assets|views)(.*)\.js$/) | ||
req.keys().map(req) | ||
angular.module('mean', packageModules) | ||
} | ||
|
||
jQuery.ajax('/_getModules', { | ||
dataType: 'json', | ||
async: false, | ||
success: processModules | ||
}); | ||
dataType: 'json', | ||
async: false, | ||
success: processModules | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,68 @@ | ||
/* globals require */ | ||
'use strict'; | ||
'use strict' | ||
|
||
/** | ||
* Module dependencies. | ||
*/ | ||
var mean = require('meanio'), | ||
compression = require('compression'), | ||
consolidate = require('consolidate'), | ||
express = require('express'), | ||
helpers = require('view-helpers'), | ||
flash = require('connect-flash'), | ||
modRewrite = require('connect-modrewrite'), | ||
// seo = require('mean-seo'), | ||
config = mean.getConfig(), | ||
bodyParser = require('body-parser'), | ||
helmet = require('helmet'); | ||
|
||
|
||
module.exports = function(app, db) { | ||
|
||
app.use(bodyParser.json(config.bodyParser.json)); | ||
app.use(bodyParser.urlencoded(config.bodyParser.urlencoded)); | ||
|
||
app.use(helmet()); | ||
|
||
app.set('showStackError', true); | ||
var mean = require('meanio') | ||
var compression = require('compression') | ||
var consolidate = require('consolidate') | ||
var express = require('express') | ||
var helpers = require('view-helpers') | ||
var flash = require('connect-flash') | ||
var modRewrite = require('connect-modrewrite') | ||
// seo = require('mean-seo'), | ||
var config = mean.getConfig() | ||
var bodyParser = require('body-parser') | ||
var helmet = require('helmet') | ||
|
||
module.exports = function (app, db) { | ||
app.use(bodyParser.json(config.bodyParser.json)) | ||
app.use(bodyParser.urlencoded(config.bodyParser.urlencoded)) | ||
|
||
app.use(helmet()) | ||
|
||
app.set('showStackError', true) | ||
|
||
// Prettify HTML | ||
app.locals.pretty = true; | ||
app.locals.pretty = true | ||
|
||
// cache=memory or swig dies in NODE_ENV=production | ||
app.locals.cache = 'memory'; | ||
app.locals.cache = 'memory' | ||
|
||
// Should be placed before express.static | ||
// To ensure that all assets and data are compressed (utilize bandwidth) | ||
app.use(compression({ | ||
// Levels are specified in a range of 0 to 9, where-as 0 is | ||
// no compression and 9 is best compression, but slowest | ||
level: 9 | ||
})); | ||
})) | ||
|
||
// Enable compression on bower_components | ||
app.use('/bower_components', express.static(config.root + '/bower_components')); | ||
app.use('/bower_components', express.static(config.root + '/bower_components')) | ||
|
||
app.use('/bundle', express.static(config.root + '/bundle')); | ||
app.use('/bundle', express.static(config.root + '/bundle')) | ||
|
||
// Adds logging based on logging config in config/env/ entry | ||
require('./middlewares/logging')(app, config.logging); | ||
require('./middlewares/logging')(app, config.logging) | ||
|
||
// assign the template engine to .html files | ||
app.engine('html', consolidate[config.templateEngine]); | ||
app.engine('html', consolidate[config.templateEngine]) | ||
|
||
// set .html as the default extension | ||
app.set('view engine', 'html'); | ||
|
||
app.set('view engine', 'html') | ||
|
||
// Dynamic helpers | ||
app.use(helpers(config.app.name)); | ||
app.use(helpers(config.app.name)) | ||
|
||
// Connect flash for flash messages | ||
app.use(flash()); | ||
app.use(flash()) | ||
|
||
app.use(modRewrite([ | ||
|
||
'!^/api/.*|\\_getModules|\\.html|\\.js|\\.css|\\.swf|\\.jp(e?)g|\\.JP(E?)G|\\.PNG|\\.png|\\.ico|\\.gif|\\.svg|\\.eot|\\.ttf|\\.woff|\\.txt|\\.pdf$ / [L]' | ||
|
||
])); | ||
'!^/api/.*|\\_getModules|\\.html|\\.js|\\.css|\\.swf|\\.jp(e?)g|\\.JP(E?)G|\\.PNG|\\.png|\\.ico|\\.gif|\\.svg|\\.eot|\\.ttf|\\.woff|\\.txt|\\.pdf$ / [L]' | ||
|
||
])) | ||
|
||
// app.use(seo()); | ||
}; | ||
// app.use(seo()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
/* globals require */ | ||
(function() { | ||
'use strict'; | ||
;(function () { | ||
'use strict' | ||
|
||
module.exports = function(app, config) { | ||
var format, options; | ||
module.exports = function (app, config) { | ||
var format, options | ||
|
||
if (config !== false) { | ||
config = config || {}; | ||
config = config || {} | ||
|
||
format = config.format || 'dev'; | ||
options = config.options || {}; | ||
format = config.format || 'dev' | ||
options = config.options || {} | ||
|
||
app.use(require('morgan')(format, options)); | ||
app.use(require('morgan')(format, options)) | ||
} | ||
}; | ||
|
||
})(); | ||
} | ||
})() |
Oops, something went wrong.