I’ve just deployed a Laravel project on App Platform. At first I defined the HTTP routes with “/api”, but then I modified the value and now the HTTP route’s values is “/”. The GET requests are working fine, but I am unable to make POST requests, I am getting 405 - "The GET method is not supported for this route. Supported methods: POST.
In my APP SPECS/services/ the routes are defined like this routes:
When checking the runtime logs I see that there was actually a GET request made
DOCUMENT_ROOT changed to 'public/' [2022-11-28 19:31:15] Assuming 512MB of RAM [2022-11-28 19:31:16] PHP memory_limit is 128M Bytes [2022-11-28 19:31:16] Starting php-fpm with 4 workers... [2022-11-28 19:31:17] Starting httpd... [2022-11-28 19:31:18] Application ready for connections on port 8080. [2022-11-28 19:31:48] 10.244.20.5 - - [28/Nov/2022:19:31:47 +0000] "GET /api/ceva HTTP/1.1" 405 93 "http://cezagora-api-ztafo.ondigitalocean.app/api/ceva" "PostmanRuntime/7.29.2
Any idea how I can fix this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.