I have express API repository which is currently hosted in Heroku along with its documentation site written in ejs
.
But now I'm planning on separating the docs website with gatsby and moving it into another repo and hosting it on Netlify while the API service still remains in Heroku.
Here is the end goal :
//example domain: example.com
"/"
// example.com/ : serves the docs website.(Netlify)
"/api"
// example.com/api : serves the API services. (Heroku)
Can someone help me with how to implement this in the actual application? I am not very familiar with separating hostings while using the same domain.
Top comments (6)
I think the easiest way would be to "move" your domain to Netlify and use it's proxy feature to proxy the API requests to Heroku. You could also use a subdomain for the API, instead of using the proxy.
Thanks for the response. I looked at the docs and that seems to be the solution. Even tho I have not tried it yet. I Will let you know if I can get it to work.
Anyway, Thank you very much π
Can I reach out to you if I need any further help with this topic?
Sure. There's an email on my GitHub profile if you need.
Great :)
Thanks so much man!
thanks for the response π¦. I really didn't know much about proxies. But after this issue I read a lot of articles on proxies and finally it's making sense. Anyway thanks for these resources :)