Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Express 有没有办法在Google App Engine中运行NPM脚本?_Express_Google App Engine_Knex.js - Fatal编程技术网

Express 有没有办法在Google App Engine中运行NPM脚本?

Express 有没有办法在Google App Engine中运行NPM脚本?,express,google-app-engine,knex.js,Express,Google App Engine,Knex.js,我有一个Express API,我想在Google App Engine上运行,它使用Knex.js进行迁移。我可以在谷歌应用程序引擎中运行knex migrate:latest?或者我该如何解决这个问题?据我所知,Knex.js是Postgres、MSSQL、MySQL、MariaDB、SQLite3、Oracle和Amazon Redshift的SQL查询生成器 您的意思是使用Knex迁移您的数据库吗?一旦您打算将API迁移到AppEngine,云SQL将是您数据库的合适选择。Knex仍然致

我有一个Express API,我想在Google App Engine上运行,它使用Knex.js进行迁移。我可以在谷歌应用程序引擎中运行
knex migrate:latest
?或者我该如何解决这个问题?

据我所知,Knex.js是Postgres、MSSQL、MySQL、MariaDB、SQLite3、Oracle和Amazon Redshift的SQL查询生成器

您的意思是使用Knex迁移您的数据库吗?一旦您打算将API迁移到AppEngine,云SQL将是您数据库的合适选择。Knex仍然致力于将数据库迁移到云SQL,您可以参考此Stackoverflow案例了解有关的信息

<> P>当API运行时使用Ext.js/JavaScript,在迁移到AppEngine之前,必须首先考虑哪个环境适合你。标准环境适用于流量突然剧增(需要扩展)的应用程序,而Flex环境适用于包含本机代码的应用程序框架(对应用程序和环境的更多控制)。有关更多信息,请参阅本手册

更具体地说,由于您的API使用的是Express.js,您只需如下所示:

{
  "dependencies": {
    "lodash": "^4.0.1",
    "express": "^4.16.2"
  }
}

部署应用程序时,Node.js运行时将自动安装所有依赖项。

因此我只需将任何npm脚本添加到包json中的启动前脚本中。是的,您只需将express作为依赖项添加到包json中。