Run a node.js server from Geany

Anderson Green picture Anderson Green · Sep 17, 2012 · Viewed 7.7k times · Source

A simple question: Is it possible to configure the Geany IDE so that Node.js servers can be run directly from Geany using the "Run" button?

Answer

Dominic Barnes picture Dominic Barnes · Sep 17, 2012

When inside a JS file, go to Build > Set Build Commands, there should be a section title Execute commands. To use node to execute your files, put: node "%f" in the "Execute" command textbox.

When you change this, any .js files you are editing will run node in the virtual terminal when you hit F5.

If you want to set up an entire project to run the server whenever you're working somewhere within a given directory structure, you'll have to mess with project-level configuration. (something I don't usually bother with) My solution here just gives you a quick way to execute a single JS file without using an external terminal.

UPDATE: node "%f" seems to be legacy, but nodejs "%f" works