Setting up Sublime Text as a node.js development environment

Setting up Sublime Text as a node.js development environment

Image courtesy of  tiramisustudio at FreeDigitalPhotos.net
Image courtesy of tiramisustudio at FreeDigitalPhotos.net
Sublime Text makes a great IDE for node.js development. First, install the node.js software and get your initial project up and running. Various tutorials on the web should get you going. When it’s time to run your app, configure the Sublime Text build system to build it and run it. To avoid having to start and stop your Node server manually, make use of the tool Nodemon – this tool will build and run your app automatically when you edit the source code.

To set up the build system, open Sublime Text, and navigate to “Tools” > “Build System” and click “New build system”. Name the file something like “node.sublime-build”, and use the following snippet as a template for your run environment setup:

The above snippet shows an example of how to set environment variables that the app will be using to configure it’s database connection.

Now, restart Sublime Text, and build your app by pressing Crtl+b. Your app should now be up and running. If your writing a REST api you might want to check out the Chrome extension Postman, a tool you can use to fire off REST calls to your Node server.

Leave a Reply

%d bloggers like this: