我在google应用程序引擎上使用react。
正如文档中所写的:
我可以访问以下环境变量:
Environment variable Description
GAE_APPLICATION The ID of your App Engine application.
GAE_DEPLOYMENT_ID The ID of the current deployment.
GAE_ENV The App Engine environment. Set to standard.
GAE_INSTANCE The ID of the instance on which your se
gh-page部署失败,下一个错误是:
Checking configuration and starting deployment…
Error: The directory you're trying to deploy named /home/runner/work/azure-flask-react/azure-flask-react/dist doesn't exist. Please double check the path and any prerequisite build scripts and try again. ❗
Deployment failed
我正在第一次将Python应用程序部署到GAE中,它使用Flask作为REST服务器,我无法理解如何正确配置部署的概念。
我正在尝试使用最小的烧瓶-restful应用程序示例minimal.py
from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class HelloWorld(Resource):
def get(self):
return {'hello': 'world'}
a
基本上,我有一个后端作为一个模块,在任何时候我只想要一个实例。我的要求是它不能扩展到超过一个实例,但是当没有请求时,它仍然关闭。
所以我选择了basic_scaling。它在开发服务器上像预期的那样工作。但是,当我将它部署到GAE上时,我注意到后端没有启动。当我访问后端URL时,我会收到超时消息:
Error: Server Error
The service you requested is not available yet.
Please try again in 30 seconds.
下面是后端模块附带的app.yaml文件:
application: vim-colorsseum
我有一个基本的flask应用程序,它使用flask_restful扩展(用于创建restful服务):
main.py
from google.cloud import datastore
from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
datastore_client = datastore.Client()
class HelloWorld(Resource):
def get(self):
# retrie
情况:
我的项目大多是自动化的任务。我的GAE (标准环境)应用程序有40个这样的crons作业,都在默认模块(前端)上运行:
- description: My cron job Nth
url: /mycronjob_n/ ###### Please note n is the nth cron job.
schedule: every 1 minutes
每个cron作业
@app.route('/mycronjob_n/')
def mycronjob_n():
for i in (0,100):
pram = prams[i]