eureka.dashboard.path doesn't seem to have any effect - spring-cloud-netflix

This could be a problem with static resource loading, but when using a custom path for the eureka dashboard, all I get is a blank page. No error, nothing in the log, just blank. Removing the custom path makes the dashboard available on "/". Here is the project to reproduce the problem:
https://github.com/knetikmedia/cluster-manager-test
Thanks

eureka.dashboard.path takes effect, but /eureka path is a default prefix used for instance for the purpose of locating static resources. Try using some different value, like /dashboard - it worked for me.

Related

Open index.html but it turns out undefined

I am a beginner of JS, I usually use live server in VS code to see if my code works properly. A weird thing happens to a project, when I run the live server, the path becomes undefined, then the website crashed. I tried to open the file from the file manager, the same situation.
My original filename: file:///D:/Desktop/trashcar/index.html
When it opens on the browser: file:///D:/Desktop/trashcar/undefined
I am not sure if I accidentally change the settings, and the unexpected thing is only in this project. I've tried to search possible cases, but it seems I am the first case. I will be thankful if someone can give me a hint on this.
Just set the pathname in your browser to file:///D:/Desktop/trashcar/index.html
You don't need a server to view static HTML.
I tried to create a new file and past the original code line by line and it fix now. I still wonder why this happens only to that file.

Chrome ERR_EMPTY_RESPONSE

I have a problem with chrome which don't display some of my static files (css, js mainly). it says that an empty response has been sent by the server
but when I try to "curl" the same URL, it works
I don't really know what's wrong here. I tried disabling cache, clearing all type of cache, incognito mode, disabling chrome extensions... none of those worked
thanks
update
If I try to access the same URL with a random parameter in query string (let's say ?id=1), it works but only once ! when I refresh the page, I get the same error, and so on...
I finally found the problem :
I had something wrong in my .htaccess file. I had module_deflate which wasn't enabled in my apache configuration, so somehow, this prevented my local website to work properly. Just enabled it in my /etc/apache/http.conf and that's it.
If you get the same problem, I would recommend to comment all your .htaccess lines and then uncomment them one by one to see if any of them can cause the problem.
hope this would help someone else.

Double base path when using push with basename

I've come across an issue which I've been trying to figure whether I'm just doing something wrong or whether it's an actual bug. After a lot of searching, I still can't figure out if I'm doing something wrong or if I've found an actual problem.
Part of the reason as to why I'm so confused is also because I found the intersection between react-router and history a bit confusing. It took me a while to figure out exactly how to use history's enhancer functions with react-router and I still think the issue might lay there.
I have a test case here:
https://github.com/trodrigues/react-router-basename-test
http://trodrigues.github.io/react-router-basename-test/
And the problem is:
Clicking the button issues a this.context.router.push call to navigate to /content/path
I'd expect it to navigate to http://trodrigues.github.io/react-router-basename-test/content/path
Instead it navigates to http://trodrigues.github.io/react-router-basename-test/react-router-basename-test/content/path
Some additional detail:
If I use the <base> tag instead of the useBasename enhancer this works fine. However, given that I have a slightly different setup for dev and production, using an environment variable to define the basepath would be more helpful, rather than manipulating the <base> tag at build time.
The sample app I uploaded is a minimal subset of the app I'm working on. I removed everything else that didn't matter.
The issue does not occur when running this locally with a basepath set to an empty string.
After some further investigation I figured out react-router already uses the useBasename enhancer when using useRouterHistory, which is the cause of the problem as the enhancer gets executed twice.

How to configure Netbeans code entry point when you use mod-rewriting

I am developing a website in PHP and I am using mod-rewrite rules. I want to use the Netbeans Run Configuration (under project properties) to set code entry points that looks like http://project/news or http://project/user/12
It seems Netbeans have a problem with this and needs an entry point to a physical file like http://project/user.php?id=12
Has anyone found a good way to work around this?
I see your question is a bit old, but since it has no answer, I will give you one.
What I did to solve the problem, was to give netbeans what it wants in terms of a valid physical file, but provide my controller (index.php in this case) with the 'data' to act correctly. I pass this data using a query parameter. Using your example of project being the web site domain and user/12 as the URL, use the following in the NetBeans Run Configuration and arguments boxes. netbeans does not need the ? as it inserts that automatically, see the complete url below the input boxes
Project URL: http://project
Index File: index.php *(put your controller name here)*
Arguments: url=user/12
http://project/index.php?url=user/12
Then in your controller (index.php in this example), test for the url query param and if it exists parse it instead of the actual Server Request, as you would do normally.
I also do not want the above URL to be publically accessible. So, by using an IS_DEVELOPER define, which is true only for configured developer IP addresses, I can control who has access that special url.
If you are trying to debug specific pages, alternatively, you can set the NetBeans run configuration to:
http://project/
and debug your project, but you must run through your home page once and since the debugger is now active, just navigate to http://project/user/12 in your browser and NetBeans will debug at that entry point. I found passing through my home page every time a pain, so I use the technique above.
Hopefully that provides enough insight to work with your project. It has worked good for me and if you need more detail, just ask.
EDIT: Also, one can make the Run Configuration Project URL the complete url http://project/user/12 and leave the Index File and Arguments blank and that works too without any special code in controller. (tested in NetBeans 7.1). I think I will start using this method.

Restlet - serving up static content

Using Restlet I needed to serve some simple static content in the same context as my web service. I've configured the component with a Directory, but in testing, I've found it will only serve 'index.html', everything else results in a 404.
router.attach("/", new Directory(context, new Reference(baseRef, "./content"));
So... http://service and http://service/index.html both work,
but http://service/other.html gives me a 404
Can anyone shed some light on this? I want any file within the ./content directory to be available.
PS: I eventually plan to use a reverse proxy and serve all static content off another web server, but for now I need this to work as is.
Well, I figured out the issue. Actually Restlet appears to route requests based on prefix, but does not handle longest matching prefix correctly, it also seems to ignore file extensions.
So for example, if I had a resource attached to "/other"... and a directory on "/". And I request /other.html, what actually happens is I get the "/other" resource. (The extension is ignored?), and not the static file from the directory as I would expect.
If aynone knows why this is, or how to change it, I'd love to know. It's not a big deal, just for testing. I think we'll be putting apache or nginx in front of this in production anyway.
Routers in Restlet by default use the "Template.MODE_STARTS_WITH" matching mode. You could always set the Router default by doing router.setMatchingMode(Template.MODE_EQUALS). This will turn on strict matching by default for attach. You can choose to override individual routes with setMatchingMode.
Good documentation on Restlet Routing