node.js - Hubot/Express: disable basic auth in a specific route -



node.js - Hubot/Express: disable basic auth in a specific route -

i using hubot , i've defined environment variables express_user , express_password enable basic authentication. hubot uses express , it's

setupexpress: -> user = process.env.express_user pass = process.env.express_password stat = process.env.express_static express = require 'express' app = express() app.use (req, res, next) => res.setheader "x-powered-by", "hubot/#{@name}" next() app.use express.basicauth user, pass if user , pass app.use express.query() app.use express.bodyparser() app.use express.static stat if stat`

i want expose http command in script doesn't need basic auth. i'm not able alter change code in hubot express it's beingness initialized

robot.router.get '/some-anonymous-path', (req, res) -> console.log 'should here without need authenticate

does know if it's possible in expressjs.

thanks in advance

bruno

how putting nginx in front end of hubot? can add together ssl, allow access specific paths, rewrite urls or serve static content created hubot scripts. simple illustration nginx.conf block:

upstream hubot { server localhost:8080; } server { hear 80; satisfy any; allow 127.0.0.1; deny all; location ~ ^/(public|obscured) { allow all; proxy_pass http://hubot; } location ~ ^/(static) { auth_basic "restricted"; auth_basic_user_file htpasswd; root /www; } location ~ { auth_basic "restricted"; auth_basic_user_file htpasswd; proxy_pass http://hubot; } }

then toss htpasswd pair in /etc/nginx/htpasswd , in hubot init script set bind_address=localhost (default bind 0.0.0.0) , you'll off races.

node.js express basic-authentication hubot

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -