On NetBeans, my Node.js server does not automatically restart after changes - netbeans

I've been using Atom, Sublime Text and Code, and all of those would make the server restart after any changes. With Netbens it doesn't happen.
I have two different servers in my project, one for the client and other for API. Simply executing the commands in either my OS's terminal or Netbeans's terminal also doesn't make the server to restart. Tried to look for suggestions but those I found also didn't happen. The solution was to modify the start file in Properties > Run and check the only checkbox it's in there, but nothing.
What's necessary to do in Netbeans to refresh the server automatically after saving any file? And also, how to run two at the same time? Client and API.

Related

How to stop VS Code from opening browser

I'm running a local server on localhost through VS Code using nodemon on my mac. So everytime I save, the server restarts and updates. My problem is that VS Code always switches window to my browser when the server restarts, so my flow gets interrupted. There must be a way to prohibit VS Code from opening my browser, or at least not doing it at every restart of server?
Look into script your nodemon runs when it's watcher detects change and locate call that starts the browser there: presumably you have one in your "start server" script.
It would probably involve your local server address and call like require('child_process').exec(); see How to use nodejs to open default browser and navigate to a specific URL.
I kind of solved it by adding "BROWSER=none" so my start script (which otherwise only said "nodemon server.js"). But then the browser won't refresh automatically and I'm still curious what's causing it.

How to reload server with changes via VS Code's liveshare shared terminal

Helping a colleague out remotely with some coding using VS Code's LiveShare extension. I'd like to work on a file, save it, and have the server reload with the changes I have made. Typically this would just hot-reload when I save the file, but it isn't because I am remotely editing via live-share session. Also, even with a shared terminal I don't know of a way to restart the server as ctrl-c will exit out of the shared terminal. Any help would be greatly appreciated!
This is probably dependent on what type of code you are working on.
If it is js/css/html, you can launch the server with no cache and turn on the debugger, when you use the "Restart" function of the debugger, it will save the file and push the new version to the server.
I use the https://www.npmjs.com/package/http-server. It can be launched with no cache using the -c-1 option.

Why eclipse preference general->workspace->refresh using native hooks or polling not working?

I'm using vim in cygwin writing javascript code, using eclipse tomcat as web server. I checked the preference refresh using native hooks or polling. But after I write the buffer in vim, the project won't get refreshed, so the hosted application won't get republished neither. Only after I press F5 on the project manually, then everything works fine. Can someone help here? What am I doing wrong?
By default, Vim writes the file contents to a temporary file and then moves that over the original, see :help backup. Since this is now a different file (handle), the hooks set up by Eclipse may stop working.
You can make Vim override the original file by setting
:set backupcopy=yes

Global variables and sessions in Developer Studio

Now it starts a session for each file you run. Is there any way to run two files using the same session (and the same global variables) in Eclipse Progress Developer Studio 3.7 (without one file running the other)?
Yes I know global variables should be avoided but that's not the topic.
You can start the Procedure Editor from Developer Studio by clicking the highlighted button.
The Procedure Editor will contain the currently active file from Eclipse. It is running in the progress process from Developer Studio that is used for compilation of the current project. So all files you start this way will be executed using the same process (as long as you do not restart the OpenEdge AVM).
In the Procedure Editor just hit F2 to execute the file. Note that this will only work for procedure files, not for classes.
There is an option in the run configuration to use the project avm instead of starting a new one.
That way subsequent runs will be in the same session.
You'll need to restart the avm to get rid of the context created by those runs
Only if you run it from the char or GUI client, and then it would still be:
run prog1.p.
run prog2.p.
so there's now way to do this w/out having a "stub" program which runs the two programs in sequence.

Reloading/Recompiling/Refreshing .beam files inside a terminal

I use Eclipse and Erlide to develop in Erlang. To run the software I enter the ebin/ directory with my terminal since I don't like the console Eclipse provides. However after each change I have to exit and re-enter erl in the terminal to reload the .beam files that have been changed. Eclipse automatically generates new .beam files into the ebin/ directory after every save.
I know I can manually compile it with the c(filename) command, but that would require me to move to the src/ directory, compile the files, and move them back to the ebin/ directory. This requires a lot more work that just exiting and entering the Erlang terminal.
I have heard of makefiles, but I don't know if they can be ran from within an Erlang terminal.
The reason I don't want to exit the terminal is because I will lose my history of previous commands. If I'm using modules:methods with long names this takes a lot of typing time for each change made.
Is there any method to reload the .beam files in the current directory while in an Erlang terminal? Or is there any way to load the previous command history of the Erlang terminal?
You can use the l(Module). command in the shell which loads, or reloads, a module from the current directory into Erlang.
I would suggest something like active or sync but straightforward approach with c/1, l/1 and nl/1 works too
[edited]
Run your application from eclipse and check the node name, the default is #. Shut that down.
Start a separate erlang node with the same name. Now when running the application from eclipse that node will get used and you can use the shell in the terminal, while erlide will be able to reload beam code automatically when saving files.