Comments (3)
The following code segments might be of interest:
Lines 69 to 71 in 567a6d5
Lines 136 to 140 in 567a6d5
And here's how I have attempted to fix this (I'm not an Express / Node.js expert by any means!):
diff --git a/server/app.js b/server/app.js
index 103fef95..2cc94bc0 100644
--- a/server/app.js
+++ b/server/app.js
@@ -136,7 +136,13 @@ for (const routesModule of routesModules) {
// Catch-all route, it should always be defined last
app.get('*', function (req, res) {
res.cookie('XSRF-TOKEN', req.csrfToken(), { sameSite: true });
- res.render('index', { base: config.get('base') });
+ if ( req.originalUrl === '/' ||
+ req.originalUrl === '/login' ||
+ req.originalUrl === '/home' ) {
+ res.render('index', { base: config.get('base') });
+ } else {
+ res.sendStatus(404);
+ }
});
module.exports = app;
from urungi.
The problem here is that the backend does not know about the frontend URLs. So it renders the index page which contains the Angular.js app and let the client's browser do the rest.
Doing what you suggest would prevent linking to (or reloading) pages other than the home page, ie. it will return a 404 for URLs like /dashboards/list
whereas it is a valid URL
from urungi.
You might want to try the stop-angularjs
branch which is in a work-in-progress state but is usable. It is an ongoing (though in pause at the moment) work to remove angular.js and it uses a more "traditional" way of handling URLs (no client-side routing).
Unknown URLs will return a 404.
from urungi.
Related Issues (20)
- Report filters don't apply to xlsx exports HOT 2
- Name field not updated in a reports when you are update him in a layer
- Currency format symbol doesn't appear HOT 1
- Dashboard not really delete
- Replace Noty HOT 1
- Display message on interface if an error from the server side occurs
- Duplicate a report within a dashboard
- CLI command `import` imports properties that should not be imported
- popover class on modal don't work
- Indicate number of values for filter in reports
- Caching results
- dropdown list in left sidebar of Explore tab had disappeared HOT 1
- Total line in tables HOT 1
- export to PDF error with pikitia HOT 16
- AngularJS long term support has ended HOT 1
- Default values in filters
- Sorting on grouped columns HOT 1
- hilight a report in a dashboard
- Change author of a report/dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from urungi.