mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-23 14:25:17 +02:00
Fix all lib/ files with ESLint rules with 0 errors.
This commit is contained in:
@@ -26,8 +26,8 @@ var markdownServe = require('markdown-serve')
|
||||
|
||||
module.exports = function(options) {
|
||||
var log = logger.createLogger('app')
|
||||
, app = express()
|
||||
, server = http.createServer(app)
|
||||
var app = express()
|
||||
var server = http.createServer(app)
|
||||
|
||||
app.use('/static/wiki', markdownServe.middleware({
|
||||
rootDirectory: pathutil.root('node_modules/stf-wiki')
|
||||
@@ -50,9 +50,9 @@ module.exports = function(options) {
|
||||
}))
|
||||
}
|
||||
else {
|
||||
log.info('Using webpack')
|
||||
// Keep webpack-related requires here, as our prebuilt package won't
|
||||
// have them at all.
|
||||
log.info('Using webpack')
|
||||
var webpackServerConfig = require('./../../../webpack.config').webpackServer
|
||||
app.use('/static/app/build',
|
||||
require('./middleware/webpack')(webpackServerConfig))
|
||||
@@ -115,7 +115,7 @@ module.exports = function(options) {
|
||||
}
|
||||
|
||||
if (options.userProfileUrl) {
|
||||
state.config.userProfileUrl = (function () {
|
||||
state.config.userProfileUrl = (function() {
|
||||
return options.userProfileUrl
|
||||
})()
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = function(options) {
|
||||
if (req.query.jwt) {
|
||||
// Coming from auth client
|
||||
var data = jwtutil.decode(req.query.jwt, options.secret)
|
||||
, redir = urlutil.removeParam(req.url, 'jwt')
|
||||
var redir = urlutil.removeParam(req.url, 'jwt')
|
||||
if (data) {
|
||||
// Redirect once to get rid of the token
|
||||
dbapi.saveUserAfterLogin({
|
||||
|
||||
@@ -14,9 +14,9 @@ var globalOptions = require('../../../../webpack.config').webpack
|
||||
// Similar to webpack-dev-middleware, but integrates with our custom
|
||||
// lifecycle, behaves more like normal express middleware, and removes
|
||||
// all unnecessary features.
|
||||
module.exports = function(options) {
|
||||
module.exports = function(localOptions) {
|
||||
var log = logger.createLogger('middleware:webpack')
|
||||
options = _.defaults(options || {}, globalOptions)
|
||||
var options = _.defaults(localOptions || {}, globalOptions)
|
||||
|
||||
var compiler = webpack(options)
|
||||
var fs = compiler.outputFileSystem = new MemoryFileSystem()
|
||||
@@ -77,12 +77,11 @@ module.exports = function(options) {
|
||||
if (valid) {
|
||||
return Promise.resolve()
|
||||
}
|
||||
else {
|
||||
log.info('Waiting for bundle to finish')
|
||||
var resolver = Promise.defer()
|
||||
queue.push(resolver)
|
||||
return resolver.promise
|
||||
}
|
||||
|
||||
log.info('Waiting for bundle to finish')
|
||||
var resolver = Promise.defer()
|
||||
queue.push(resolver)
|
||||
return resolver.promise
|
||||
}
|
||||
|
||||
return function(req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user