First of all, thank you for this amazing Glitch service. I am now able to host my backend here on the glitch cloud — well not quite yet.
I have my backend server setup here on glitch site. I have only 1 GET http method and multiple POST methods. My GET URI is: https://tenzinhub-api.glitch.me/api/ttc/routes/all
My frontend is developed via Nuxt.js (Vue.js) and hosted on Github Pages. I have successfully confirmed that my Glitch-hosted backend is able to serve my locally compiled (development mode). It is also confirmable since the above link shows a lengthy JSON data.
However, my ‘Github Pages’ hosted static website is unable to get API data. The ERROR message simply says I have a ‘405’ error code - this is the ‘Method Not Allowed’.
I initially thought I had a CORS problem since I was giving a PORT number of 3001. However, even after enabling CORS for every website, this problem still persists, so this is not CORS.
My current suspicion is that Glitch is not allowing Github Page hosted website, since the error code 405 is mysterious and not easy to resolve.
My code are public:
- for my backend, I’m using express.js.
- for my frontend (in github):
- I’m using Nuxt.js, $http (which internally uses
ky), proxy enabled obviously
Any help is appreciated. Please feel free to ask any further questions if I need to clarify something. Thank you for reading