Open theherk opened 10 years ago
Everything looks correct. I don't understand why it tries to execute split, a String operation, on a function (Object).
grunt.registerTask('serve', function (target) {
if (target === 'dist') {
return grunt.task.run([
'build',
'open',
'configureHttpAuth',
'configureProxies',
'connect:dist:keepalive'
]);
}
grunt.task.run([
'configureHttpAuth',
'configureProxies',
'clean:server',
'concurrent:server',
'connect:livereload',
'open',
'watch'
]);
});
Is Gruntfile.js working without configureHttpAuth in the task 'serve'?
Can you tell me which versions you using (npm list)? Maybe the interface of http-auth changed. I'm using 1.2.9.
Did you mount a folder after modAuth? Maybe that could be the problem.
livereload: {
options: {
middleware: function (connect) {
return [
modAuth,
proxySnippet,
lrSnippet,
mountFolder(connect, '.tmp'),
mountFolder(connect, yeomanConfig.app)
];
}
}
},
Last option. In my project I have 'auth' before 'livereload'. It would be stupid when that would be the reason. But if it helps you…
You may have accidentally pointed out an important difference. You say modAuth
, but according to the docs I am returning authRequest
. What should be returned?
Also, I am using 1.2.9, as well. I will try and reverse the order under connect, but I would love if you could clarify what to return in the middleware.
As an aside, do the default middlewares still get returned, even if overridden or does middlewares need to be returned with authRequest/modAuth?
My var is called modAuth
, but the content is the same. What you doing is correct.
var modAuth = require('grunt-connect-http-auth/lib/utils').authRequest;
Also, I am using 1.2.9, as well. I will try and reverse the order under connect, but I would love if you could clarify what to return in the middleware.
I don't understand your question.
As an aside, do the default middlewares still get returned, even if overridden or does middlewares need to be returned with authRequest/modAuth?
I hope I understand is question correct. Every middleware is adding or removing something to the http request and/or response. Every middleware passing these attributes to the next middleware till all middlewares are done.
Your authRequest
is not replace the other middlewares, it's just adding basic authentication to the request.
I cannot seem to get past this error:
I am sure I am just being new at this and making a stupid mistake. Or perhaps there is a difference in how things operate from version to version.
Here is my current Gruntfile.js:
I can do this without auth, but it would be helpful. Am I confused if I am just making a mistake or what. Any ideas?