Home Can't reach backend when url base is set
Reply: 0

Can't reach backend when url base is set

mikeyGlitz
1#
mikeyGlitz Published in 2017-12-07 13:13:49Z

I have an application built using Express, Mongoose, React and Node. My application is hosted on a location which looks like the following: https://example.com/app_name which means that app_name is the base path for all of the static assets.

I'm using Webpack and setting publicPath to https://example.com/app_name. I can reach my static assets just fine, but when I attempt to do a call to my back-end, my requests are being routed to https://example.com/api/... instead of https://example.com/app_name/api/....

Is there a way to prefix my endpoint calls so that they use https://example.com/app_name/api/... instead of https://example.com/api/...through webpack or any other means?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.298389 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO