Firebase托管烧瓶应用程序

时间:2017-12-03 12:50:32

标签: python firebase flask firebase-hosting

我正在尝试在黑客马拉松项目中托管一个简单的烧瓶应用程序,但我遇到了一个无法识别路径的问题。例如,假设我的烧瓶路线是:

@app.route('/helloWorld', methods=['POST'])
    def index():
        inputted_name = request.form['nm']
        return 'Hello World ' + inputted_name

我的index.html是

<html>
   <body>

      <form action = "{{ url_for('helloWorld') }}" method = "post">
         <p>Enter Name:</p>
         <p><input type = "text" name = "nm" /></p>
         <p><input type = "submit" value = "submit" /></p>
      </form>

   </body>
</html>

和我的firebase.json

{
      "hosting": {
          "public": "folder_containing_above"
      }
}

在firebase上托管时,我似乎无法让html与flask路径对话,并返回Hello world字符串。相反,它说

找不到页面 此文件不存在,并且在当前目录或根目录中的404.html中找不到index.html。

感谢任何帮助!

0 个答案:

没有答案