当前位置: 首页 > 知识库问答 >
问题:

Heroku给我方法不允许[关闭]

司空昊阳
2023-03-14

这个问题是由打字错误或无法再复制的问题引起的。虽然这里可能有类似的问题,但这个问题的解决方式不太可能对未来的读者有所帮助。

原始关闭原因未解决

好的,我已经研究这个问题好几个小时了,不知道如何解决这个问题,因为我只是一个新手。当时我正在学习科尔特·斯蒂尔(Colt Steele)的一门名为WEBDEVBOOTCAMP的UDEMY课程。在部署部分,每次我使用Heroku部署时,这都会给我一个“不允许的方法”。我一直在遵循科尔特的方式从零开始,这就是为什么我想知道为什么它是这样的。

这些是我收到的Heroku日志:

2017-08-07T21:45:10.990742+00:00 heroku[web.1]: Starting process with command `npm start`
2017-08-07T21:45:14.881336+00:00 app[web.1]: 
2017-08-07T21:45:14.881350+00:00 app[web.1]: > v1@1.0.0 start /app
2017-08-07T21:45:14.881352+00:00 app[web.1]: 
2017-08-07T21:45:14.881351+00:00 app[web.1]: > node app.js
2017-08-07T21:45:16.594550+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2017-08-07T21:45:16.594555+00:00 app[web.1]: designed for a production 
environment, as it will leak
2017-08-07T21:45:16.594556+00:00 app[web.1]: memory, and will not scale past a single process.
2017-08-07T21:45:16.610398+00:00 app[web.1]: (node:17) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
2017-08-07T21:45:16.612243+00:00 app[web.1]: The Yelp Camp Server is up!
2017-08-07T21:45:16.665653+00:00 app[web.1]: Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.
2017-08-07T21:45:16.914410+00:00 heroku[web.1]: State changed from starting to up
2017-08-07T21:54:00.075655+00:00 app[api]: Starting process with command `ls` by user lao_tabudlong@yahoo.com
2017-08-07T21:54:03.051279+00:00 heroku[run.4055]: Awaiting client
2017-08-07T21:54:03.090885+00:00 heroku[run.4055]: Starting process with command `ls`
2017-08-07T21:54:03.268924+00:00 heroku[run.4055]: State changed from starting to up
2017-08-07T21:54:08.289699+00:00 heroku[run.4055]: Process exited with status 0
2017-08-07T21:54:08.303853+00:00 heroku[run.4055]: State changed from up to complete
2017-08-07T22:16:51.093190+00:00 heroku[web.1]: Idling
2017-08-07T22:16:51.093810+00:00 heroku[web.1]: State changed from up to down
2017-08-07T22:16:52.026960+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-08-07T22:16:52.187881+00:00 heroku[web.1]: Process exited with status 143
2017-08-07T22:38:33.000000+00:00 app[api]: Build started by user lao_tabudlong@yahoo.com
2017-08-07T22:38:44.152229+00:00 heroku[web.1]: State changed from down to starting
2017-08-07T22:38:43.802847+00:00 app[api]: Deploy 8174904f by user lao_tabudlong@yahoo.com
2017-08-07T22:38:43.802847+00:00 app[api]: Release v5 created by user lao_tabudlong@yahoo.com
2017-08-07T22:38:33.000000+00:00 app[api]: Build succeeded
2017-08-07T22:38:45.764651+00:00 heroku[web.1]: Starting process with command `npm start`
2017-08-07T22:38:48.251552+00:00 app[web.1]: 
2017-08-07T22:38:48.251586+00:00 app[web.1]: > yelpcamp@1.0.0 start /app
2017-08-07T22:38:48.251586+00:00 app[web.1]: > node app.js
2017-08-07T22:38:48.251587+00:00 app[web.1]: 
2017-08-07T22:38:49.001981+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2017-08-07T22:38:49.001994+00:00 app[web.1]: designed for a production environment, as it will leak
2017-08-07T22:38:49.001995+00:00 app[web.1]: memory, and will not scale past a single process.
2017-08-07T22:38:49.018239+00:00 app[web.1]: (node:17) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
2017-08-07T22:38:49.020061+00:00 app[web.1]: The Yelp Camp Server is up!
2017-08-07T22:38:49.043200+00:00 app[web.1]: Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.
2017-08-07T22:38:49.214038+00:00 heroku[web.1]: State changed from starting to up
2017-08-07T23:10:56.925104+00:00 heroku[web.1]: Idling
2017-08-07T23:10:56.925706+00:00 heroku[web.1]: State changed from up to down
2017-08-07T23:10:58.007504+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-08-07T23:10:58.359969+00:00 heroku[web.1]: Process exited with status 143
2017-08-08T04:47:35.000000+00:00 app[api]: Build started by user lao_tabudlong@yahoo.com
2017-08-08T04:47:45.285929+00:00 heroku[web.1]: State changed from down to starting
2017-08-08T04:47:35.000000+00:00 app[api]: Build succeeded
2017-08-08T04:47:45.069248+00:00 app[api]: Release v6 created by user lao_tabudlong@yahoo.com
2017-08-08T04:47:45.069248+00:00 app[api]: Deploy f14ef4fc by user lao_tabudlong@yahoo.com
2017-08-08T04:47:46.628278+00:00 heroku[web.1]: Starting process with command `npm start`
2017-08-08T04:47:48.774464+00:00 app[web.1]: 
2017-08-08T04:47:48.774484+00:00 app[web.1]: > yelpcamp@1.0.0 start /app
2017-08-08T04:47:48.774485+00:00 app[web.1]: > node app.js
2017-08-08T04:47:48.774486+00:00 app[web.1]: 
2017-08-08T04:47:49.444240+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2017-08-08T04:47:49.444256+00:00 app[web.1]: designed for a production environment, as it will leak
2017-08-08T04:47:49.444256+00:00 app[web.1]: memory, and will not scale past a single process.
2017-08-08T04:47:49.454406+00:00 app[web.1]: (node:17) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
2017-08-08T04:47:49.455893+00:00 app[web.1]: The Yelp Camp Server is up!
2017-08-08T04:47:49.472576+00:00 app[web.1]: Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.
2017-08-08T04:47:49.919585+00:00 heroku[web.1]: State changed from starting to up
2017-08-08T05:21:42.640479+00:00 heroku[web.1]: Idling
2017-08-08T05:21:42.641117+00:00 heroku[web.1]: State changed from up to down
2017-08-08T05:21:43.112034+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-08-08T05:21:43.397138+00:00 heroku[web.1]: Process exited with status 143
2017-08-08T05:35:24.000000+00:00 app[api]: Build started by user lao_tabudlong@yahoo.com
2017-08-08T05:35:34.046061+00:00 app[api]: Release v7 created by user lao_tabudlong@yahoo.com
2017-08-08T05:35:34.046061+00:00 app[api]: Deploy 52579a31 by user lao_tabudlong@yahoo.com
2017-08-08T05:35:34.347211+00:00 heroku[web.1]: State changed from down to starting
2017-08-08T05:35:24.000000+00:00 app[api]: Build succeeded
2017-08-08T05:35:36.040512+00:00 heroku[web.1]: Starting process with command `npm start`
2017-08-08T05:35:38.881422+00:00 app[web.1]: 
2017-08-08T05:35:38.881446+00:00 app[web.1]: > yelpcamp@1.0.0 start /app
2017-08-08T05:35:38.881447+00:00 app[web.1]: > node app.js
2017-08-08T05:35:38.881448+00:00 app[web.1]: 
2017-08-08T05:35:39.981312+00:00 heroku[web.1]: State changed from starting to up
2017-08-08T05:35:39.914694+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2017-08-08T05:35:39.914717+00:00 app[web.1]: designed for a production environment, as it will leak
2017-08-08T05:35:39.914718+00:00 app[web.1]: memory, and will not scale past a single process.
2017-08-08T05:35:39.932988+00:00 app[web.1]: (node:17) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
2017-08-08T05:35:39.935319+00:00 app[web.1]: The Yelp Camp Server is up!
2017-08-08T05:35:39.967512+00:00 app[web.1]: Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.
2017-08-08T05:49:20.000000+00:00 app[api]: Build started by user lao_tabudlong@yahoo.com
2017-08-08T05:49:31.423119+00:00 heroku[web.1]: Restarting
2017-08-08T05:49:31.425641+00:00 heroku[web.1]: State changed from up to starting
2017-08-08T05:49:31.128129+00:00 app[api]: Deploy 98890a0e by user lao_tabudlong@yahoo.com
2017-08-08T05:49:31.128129+00:00 app[api]: Release v8 created by user lao_tabudlong@yahoo.com
2017-08-08T05:49:32.024642+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-08-08T05:49:32.234319+00:00 heroku[web.1]: Process exited with status 143
2017-08-08T05:49:20.000000+00:00 app[api]: Build succeeded
2017-08-08T05:49:33.865572+00:00 heroku[web.1]: Starting process with command `npm start`
2017-08-08T05:49:36.912525+00:00 app[web.1]: 
2017-08-08T05:49:36.912549+00:00 app[web.1]: > yelpcamp@1.0.0 start /app
2017-08-08T05:49:36.912550+00:00 app[web.1]: > node app.js
2017-08-08T05:49:36.912550+00:00 app[web.1]: `enter code here`
2017-08-08T05:49:38.250325+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2017-08-08T05:49:38.250352+00:00 app[web.1]: designed for a production environment, as it will leak
2017-08-08T05:49:38.250353+00:00 app[web.1]: memory, and will not scale past a single process.
2017-08-08T05:49:38.270747+00:00 app[web.1]: (node:17) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
2017-08-08T05:49:38.273329+00:00 app[web.1]: The Yelp Camp Server is up!
2017-08-08T05:49:38.314596+00:00 app[web.1]: Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.
2017-08-08T05:49:38.342241+00:00 heroku[web.1]: State changed from starting to up

共有3个答案

上官联
2023-03-14

当你使用错误的链接时,这个问题很容易出现

你的链接应该像https://test-name.herokuapp.com/

文喜
2023-03-14

我也面临同样的问题。检查您的url,您可能正在打开以结尾的url。git。相反,请转到heroku仪表板,然后使用正确的url从那里打开应用程序。

闾丘博
2023-03-14

来自Q

“确保您正在尝试访问打印到控制台的正确链接。您不应该尝试加载以. git结尾的链接,因为那只是存储库位置。

你的链接应该是这样的https://your-app-name.herokuapp.com/"

 类似资料:
  • 我使用指南创建了一个简单的Spring Boot REST服务,当我发帖到时,遇到以下错误 -“状态”:405,“错误”:“不允许使用方法”,“异常”:“org.springframework.web.HttpRequestMethodNotSupportedException”,“消息”:“不支持请求方法'POST'”, 我没有找到任何关于如何解决错误的信息。我使用的是版本1.3.2。发布并使用

  • 我有一个非常简单的Spring引导应用程序,它由以下代码保护: 这个想法是为了保护“admin”部分。它公开了一个RESTAPI。问题是所有的帖子都被退回了 405方法不允许 如果我从应用程序中删除安全启动器,它就会工作。这让我相信安全配置是问题所在。但我不知道怎么做。

  • 从Laravel开始,我在尝试发布到我的一个页面时遇到了一个问题。 我正在使用邮递员创建一个帖子请求到我的 /clock页面。 这篇文章发送了一个简单的Json,只有一个字段: 以下是邮报的标题: 我的路线当前位于路线/api中。php文件夹,并包含以下内容: 它链接到如下所示: 当我在邮递员执行后,这是我得到的错误:

  • 问题内容: 我正在开发flask注册表格,但收到错误消息: 码: registration.html: 当我访问时,我收到错误消息。我究竟做错了什么? 问题答案: 这是因为在定义路由时仅允许POST请求。 当你在浏览器中访问时,它将首先执行GET请求。只有提交表单后,浏览器才会执行POST。因此,对于像你这样的自我提交表单,你需要同时处理两者。 使用 应该管用。

  • 问题内容: 我打算使用Ajax将跨域请求发送到soap Web服务。Web服务的URL是:http://example1.asmx?op = GetVOD 我的代码: 在IIS 7服务器端,我已经将这些行添加到文件web.config中 当我在Chrome上运行客户端代码时,出现405错误: 有谁知道如何解决这个问题? 预先感谢 问题答案: 听起来像Web DAV正在阻碍。这是删除它的配置: ht

  • 我有一个restcontroller和post方法,带有以下url和json请求。http://server/member/sc/v1/limited-liability/medicare 使用post方法和json请求在本地触发请求时,获得正确的响应。但在docker中以spring boot应用程序的形式运行会将异常作为不允许的方法抛出。最初,我将这个docker服务部署为put方法。现在我转