在使用 firebase 配置 angular 后尝试“ng serve”时,出现错误。即使我用谷歌搜索了这个错误信息,但找不到任何东西。在错误消息中,此问题与库本身有关。
user@user-MacBookPro post % ng serve
10% building 3/3 modules 0 active? ?wds?: Project is running at http://localhost:4200/webpack-dev-server/
? ?wds?: webpack output is served from /
? ?wds?: 404s will fallback to //index.html
chunk {main} main.js, main.js.map (main) 2.15 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 127 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 9.78 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 340 …Run Code Online (Sandbox Code Playgroud) 我使用 Python Flask、HTML 和本地 JSON 文件以 HTML 格式显示来自本地 JSON 文件的 JSON 数据。烧瓶读取本地 JSON 文件后,将使用 jsonify将其发送到index.html。之后,使用该数据我想显示信息。
我可以在 Flask 端获取 JSON 数据,但在 HTML 中显示它时遇到了困难。你能告诉我我错过了什么吗?
烧瓶代码
import os
from flask import Flask, render_template, abort, url_for, json, jsonify
import json
import html
app = Flask(__name__)
# read file
with open('./data/file.json', 'r') as myfile:
data = myfile.read()
@app.route("/")
def index():
return render_template('index.html', title="page", jsonfile=jsonify(data))
app.run(host='localhost', debug=True)
Run Code Online (Sandbox Code Playgroud)
索引.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="UTF-8" />
<title>House</title>
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" …Run Code Online (Sandbox Code Playgroud)