I did deploy of VueJS with Vite app as a static Website. In project I have folder api-mockups with json files. When I access those files over https I get 405 Method not allowed. But when I hit those endpoints from postman as http, it works fine. How to configure server to enable https access as well?
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.
This comment has been deleted
Hey,
Since you’re dealing with a static site deployment, it’s important to note that static site servers are typically configured to serve files via GET requests and may not support POST requests for accessing static files like your JSON mockups.
This would explain why you’re seeing a 405 error; the server does not allow POST methods on the requested resource.
Here are some approaches to resolve this issue:
Use GET Requests for Static Files: If your application is attempting to access static JSON files using POST requests, consider changing these requests to GET. Since these files are static, using GET requests is more semantically correct and should be supported by the server.
Server Configuration: On the DigitalOcean App Platform for static sites, you have limited control over the web server configuration since it’s a Platform as a Service offering. This means you cannot directly change the server settings to allow POST requests for static files. If this is a requirement for you, you might want to consider using a Droplet instead where you have full root access and you can make any configuration changes that you need.
API Service: If your application logic requires POST requests (for example, if you’re sending data to the server that determines the response), consider deploying a separate API service that can handle these requests. You can deploy a small server-side application (using Express.js with Node.js, Flask with Python, etc.) alongside your static site on the DigitalOcean App Platform. This API service can then respond to POST requests and serve the necessary JSON data.
Let me know how it goes!
Best,
Bobby