diff --git a/app/src/app/app.module.ts b/app/src/app/app.module.ts index f3b2050..ac5b5f0 100644 --- a/app/src/app/app.module.ts +++ b/app/src/app/app.module.ts @@ -19,7 +19,7 @@ import { BlocksProvider } from '../providers/blocks/blocks'; BrowserModule, HttpModule, PagesModule, - IonicModule.forRoot(InsightApp) + IonicModule.forRoot(InsightApp, {locationStrategy: 'path'}) ], bootstrap: [IonicApp], entryComponents: [ diff --git a/bitcore-node/index.js b/bitcore-node/index.js index 53dd18a..ab248c5 100644 --- a/bitcore-node/index.js +++ b/bitcore-node/index.js @@ -45,13 +45,15 @@ InsightUI.prototype.getRoutePrefix = function() { InsightUI.prototype.setupRoutes = function(app, express) { var self = this; app.use(express.static(__dirname + '/../app/www')); - // if not in found, fall back to indexFile (404 is handled client-side) - /* - app.use(function(req, res) { - res.setHeader('Content-Type', 'text/html'); - res.send(self.indexFile); + app.use((req, resp, next) => { + const url = req.originalUrl; + if (!url.includes("#") && !url.includes(".")) { + const redirectTo = `/#${url}`; + resp.redirect(redirectTo); + } else { + next(); + } }); - */ }; InsightUI.prototype.filterIndexHTML = function(data) {