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?