linemanjs / lineman

Lineman helps you build fat-client JavaScript apps. It produces happiness by building assets, mocking servers, running specs on every file change
MIT License
1.18k stars 83 forks source link

How can I use `lineman serve` with basic auth? #341

Closed mark-rushakoff closed 9 years ago

mark-rushakoff commented 9 years ago

Does lineman have a built-in way to start the server behind a simple basic auth server? My use case is that we have a development server facing the public internet, and while we don't want the app to be accessible to the internet, we can accept basic auth as "good enough" for this case.

If there isn't a way to do it already, would you accept a pull request?

searls commented 9 years ago

This won't help your problem, but @jasonkarns and I did this once in a roundabout way on a client project. I believe in that case all we did was set up Basic Auth on our API server (to which we were proxying requests to anyway).

Otherwise, I'd start looking into Express 3's options (or related modules) that enable basic auth. It's probably as simple as finding that and then wrapping your app in it in your config/server.js.

mark-rushakoff commented 9 years ago

Thanks for the quick response. When we get around to configuring Express with basic auth, I'll try to update the issue here with how we fixed it (hopefully others will find it useful).

mark-rushakoff commented 9 years ago

We ended up binding the server to localhost and using an SSH tunnel, instead of using basic auth as asked in the original post. Closing because I don't have plans to revisit the topic.