diff --git a/docs/Routing.md b/docs/Routing.md index 74a7eed5d8c..189f714f1f0 100644 --- a/docs/Routing.md +++ b/docs/Routing.md @@ -1,5 +1,7 @@ # Routing +NOTE: Seems like none of this document is actually applied in Data Hub so we can remove it + ## [React Router] & [Express] Until we achieve the very unlikely state of the application where there would diff --git a/src/apps/dashboard/index.js b/src/apps/dashboard/index.js index 0e0ce4babf3..ff712cc05c5 100644 --- a/src/apps/dashboard/index.js +++ b/src/apps/dashboard/index.js @@ -2,7 +2,7 @@ const router = require('express').Router() const urls = require('../../lib/urls') const { renderDashboard } = require('./controllers') -const spaBasePath = require('../../middleware/spa-base-path') +// const spaBasePath = require('../../middleware/spa-base-path') module.exports = { router: router.get( @@ -15,7 +15,7 @@ module.exports = { urls.exportPipeline.index(), urls.dashboard.myTasks(), ], - spaBasePath(urls.dashboard.index.route), + // spaBasePath(urls.dashboard.index.route), renderDashboard ), } diff --git a/src/client/provider.jsx b/src/client/provider.jsx index b78905e574e..60d872b1c67 100644 --- a/src/client/provider.jsx +++ b/src/client/provider.jsx @@ -25,7 +25,9 @@ const history = createBrowserHistory({ // The baseURI is set to the tag by the spaFallbackSpread // middleware, which should be applied to each Express route where // react-router is expected to be used. - basename: encodeURIComponent(new URL(document.baseURI).pathname), + // basename: encodeURIComponent(new URL(document.baseURI).pathname), + // basename: qs.stringify(new URL(document.baseURI).pathname), + // basename: new URL(document.baseURI).pathname, }) const store = configureStore({ diff --git a/src/middleware/spa-base-path.js b/src/middleware/spa-base-path.js index 0cb088bf7a2..4c70071055a 100644 --- a/src/middleware/spa-base-path.js +++ b/src/middleware/spa-base-path.js @@ -1,3 +1,4 @@ +// TODO: Seems like this whole module lost its purpose and can be removed const Layer = require('express/lib/router/layer') const { NotFoundError } = require('./errors') @@ -21,6 +22,7 @@ const { NotFoundError } = require('./errors') * ) */ module.exports = (path) => (req, res, next) => { + throw Error('AAAAAAAAAAAAAAAA') const layer = new Layer(path + '*', {}, () => {}) if (layer.match(req.path)) { // We need to remove the trailing part of the path configured in the express