Last active
December 20, 2015 21:59
-
-
Save michikono/6201608 to your computer and use it in GitHub Desktop.
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
module.exports = function (app, config, passport, express) { | |
var kue = require("kue"); | |
var auth = express.basicAuth(function(user, pass, callback) { | |
var result = (user === 'username' && pass === 'password'); | |
callback(null /* error */, result); | |
}); | |
// any kue related settings can go here | |
kue.app.set('title', 'Jobs'); | |
// create a wrapper to add auth on since without it we can't globally wrap kue's paths | |
var subApp = express() | |
// add authentication | |
subApp.use(auth) | |
// re-add kue.app (but dont put it in its own folder) | |
subApp.use('', kue.app) | |
// bind the subApp to the desired path | |
app.use('/secret_location/kue', subApp) | |
}; |
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
var app = express() | |
// needs to come early due to order mattering | |
require('./config/kue')(app, config, passport, express) | |
// express settings | |
require('./config/express')(app, config, passport) | |
// the rest of your routes, etc. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error: Internal: Object function createApplication() has no method 'basicAuth'