Код: Выделить всё
Error: User code failed to load. Cannot determine backend specificationКод: Выделить всё
import json
from firebase_functions import https_fn
from firebase_admin import initialize_app, firestore
import flask
from enum import Enum
from flask import g
from endpoints.moon_phase import moon_phase_bp
# Initialize Firebase app and Firestore
initialize_app()
db = firestore.client()
app = flask.Flask(__name__)
# Set up a before_request function to make db available in blueprints
@app.before_request
def before_request():
# g.db = db
print("before_request")
app.register_blueprint(moon_phase_bp) //Doesn't even use db, but in the future it will.
# Firebase Function to handle requests
@https_fn.on_request()
def astro(req: https_fn.Request) -> https_fn.Response:
with app.request_context(req.environ):
return app.full_dispatch_request()
В чем здесь может быть проблема?
Подробнее здесь: https://stackoverflow.com/questions/790 ... e-deployed
Мобильная версия