I am always working in the Windows for web app development, and sometimes I need to setup a simple Web Server, and I always use the Python SimpleHTTPServer method, which is nice.
python -m SimpleHTTPServer
and of course, the default port is 8000.
But I find one problem that, sometimes when I cancel or stop the SimpleHTTPServer, the localhost:8000 is still working, and the page stilled can be loaded.
So what the reason for this issue? How can I clean it.
Regards
Edit
Find one solution to remove from DevTool of Chrome Browser. Need some simple setting
Related
I have a Unity project, where you can navigate around in a 3D space environment. I'm using Unity version 2020.3.4f1 Personal. I went to 'Build settings', chose WebGL, and then clicked 'Build And Run.
The project seems to launch on a Chrome browser in localhost, without any issues:
However, when I zip the build files & folders (index.html file along with the 'Build' and 'StreamingAssets'), then host as a website, all I get is a grey screen, instead of an interactive website!
As mentioned the build created is - index.html file, 'Build' folder, and 'StreamingAssets' folder:
Clearly, there's something wrong with the build as the project seems to run fine directly in localhost.
Any help would be really appreciated.
Many thanks
Edit
Looking at the logs in the Chrome browser console (running on localhost), these are the logs:
For the 404 error, I found some Unity forum thread: https://forum.unity.com/threads/webgl-builds-only-partially-working.357591/ , where I then thought the solution was to enable Data Caching & Decompression Fallback, and set Compression Format Gzip.
But this didn't solve the issue, as I still get the 404 in the console log, running on localhost (although as mentioned before, in localhost it runs). Also, when hosting it on a server using Netlify it still shows just a Grey window.
Note: strangely when I refresh the browser running localhost, the 404 disappears, but still the main thing is that when hosted on a remote server (Netlify), I just get a Grey window.
Localhost will be case-insensitive on Windows, while Linux is usually case sensitive on the Host. Check URLs and file names, and try looking at the Web server logs for 404 errors.
really confused about this and don't know where to start.
Basically i have generated a new angular project with the "dotnet new angular" command.
Im using a fresh machine, node, npm etc etc are all up to date.
My issue is this template just does not work out of the box. When i run the application, all of the frontend will load however, any requests to the api's etc will 404 stating that it cannot find the url.
Message in Chrome console: "Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment..."
My application runs on a different port everytime I execute the "dotnet run" command. Is this supposed to be the case ? Whichever port is generated, this will be the problematic one.
I have to manually change to port 5001 for anything to function correctly (although this comes with annoying security prompts.)
I am using visual studio code for this project. The funny thing is, if i run this project via visual studio (not code) i get a consistent static port number that will function as intended (this also comes with annoying security prompts) so i have to assume its this random port number that vscode is generating ?
Im honestly not to familiar with this so I could be way off admittedly. Any help or advice would be appreaciated. I'd post code snippets if I knew where to start.
PS, I know that I can of course just not run it with VSCode and just stick to Visual Studio. I'd rather understand the issue than ignore it though.
Thanks, in advance.
I generated a full app from the command console:
mojo generate app MyApp
After that i started the dev server:
morbo myapp
I changed some code, even changed the name of the default controller, but i can not see any changes in the browser, only if i restart the morbo server works.
This is reallly annoying for developing.
How to get rid of this caching behaviour?
UPDATE: i noticed if i use hypnotoad instead morbo, works and updates changes properly, so the problem is morbo.
I've never had this problem before but there is watch().
http://mojolicio.us/perldoc/Mojo/Server/Morbo#watch
Maybe if you explicitly tell the server where to look for
changed files it will work. Or, perhaps that can help you
find where the problem is.
On an aditional note, if you want to have live updates directly using morbo+fullapp you should cd to the app's folder then run
$ morbo script/myapp
It would then work properly.
New to Sinatra, just development server up and running but rackup is using WEBrick instead of Thin, Thin gem is already installed, this has to be a simple configuration tweak but I don't know where. Oh while you are at it, does Thin auto-refresh when I change the source code? It appears that I have to stop and restart WEBrick when I make source code changes.
EDIT
As suggested, thin start works with a tweak for my setup. By itself, it throws an error "start_tcp_server": no acceptor (RuntimeError) which means I already have another service running on that port. To resolve the issue, I simply run thin start -p 9292. Hope this helps someone else.
I believe you'll likely just want to start up thin via something like:
bundle exec rackup -s thin
If you're on OSX you might want to check out Pow for your development environment.
For reloading files between requests: How to get Sinatra to auto-reload the file after each change?
You can start the server with Thin using just $ thin start.
If you want code reloading, use one of the several reloading libraries in the wild: Shotgun (which will fork and exit for every request, does not work on Windows), Rack Reloader (which is a Rack middleware) or Sinatra Reloader. I personally favor Sinatra Reloader, since it just reloads files that have changed and is therefore faster. Also there's the possibility to add additional files which shall be reloaded and files that must not be reloaded.
So I am attempting to modify an application written by another programmer. The program is written in Perl and apparently uses the Catalyst framework neither of which I have any experience with.
The code is well documented and my modifications seem pretty straightforward however when I try to change something (in the the controllers to be specific) the same to take no effect. Am I missing a step? I open the file edit it, save it, and try to load the web app in my browser. I've even deleted the entire contents of one of the controllers to see if it would break the application and it did not.
Please Help.
Thanks,
Ken
If the application was set-up in a sane way (using uri_for(_action) in templates and not specifically relying on the server/env/etc) you should be developing with the dev server. There are some practices that can make this difficult:impossible without modifications. This is all you should have to do–
cd {APPLICATION DIRECTORY}
# Read about it-
perldoc script/*_server.pl
# Run it-
script/*_server.pl -r -d
Unless there is something wonky in the setup, you’ll get http://localhost:3000/ running with your app.
Or, what is probably a good idea, run the application as the webuser in your apache setup. If there are files or access expected to be for that user, it might be important (e.g., if session or cache files are used and restricted to the user)–
sudo -u www script/*_server.pl -r -d
The flags turn on debugging output and the restarter so that every time you change files in the application, the server will restart automatically (if it compiles).
Catalyst is a joy to develop with and the dev server is part of why.