2020-Feb-20
CMSB
A minimal Express web server for serving FacetReactClient.
The webpack development server typically expects the application to be served from a root path '/'. If the application is deployed from a static file server, for instance a Virtuoso WebDAV folder http://virtuoso-host/DAV/..., the root path is no longer '/'. Consequently serving FacetReactClient from a static file server will usually fail.
FacetReactClient uses client-side routing in the form of React Router. If the entry page is '/facet/index.html', requests for pages on a subpath, say '/facet/admin/' need to result in the client being served '/facet/index.html', as this page renders the notional subpath pages. The subpath pages don't exist. The routes in this minimal Express web server perform this rerouting to '/facet/index.html'
http://osdb.openlinksw.com:4433/facet/
The base path from which FacetReactClient is served is set in FacetReactClient/src/index.js, through the basename property, i.e. <BrowserRouter basename="/facet">. The baseUrl property in FacetReactClientDeploy/frcd/config.js must match this basename.