dongzhou5344 2016-11-25 15:25
浏览 45
已采纳

Heroku htaccess基本身份验证上的Golang应用

Is possible use htaccess on golang application running in heroku??
I had read this link but the solution doesn't work for me (also, the command htpasswd is not recognized in the heroku bash, but I made the htpasswd file usin this tool).

Thank you.

  • 写回答

1条回答 默认 最新

  • dsm42026 2016-11-28 21:33
    关注

    A Go web application is a server so no need to use Apache httpd server, especially on Heroku that has crystal clear deployment instructions for Go :

    https://devcenter.heroku.com/categories/go

    Follow these instruction closely and you'll find out there is no need for Apache.

    htaccess and htpasswd are related to Apache httpd server, they are Apache configuration files.

    Finally, Go standard library gives you all the tools you need to implement basic auth yourself :

    https://golang.org/pkg/net/http/#Request.BasicAuth

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?