Webstorm run/debug mean-stack
Blogs20142014-03-14
Webstorm run/debug mean-stack
I setup MEAN codes from http://www.mean.io/ in a Webstorm env.
- Make sure node.js, npm, bower, grunt are installed and accessible from WebStorm.
- Make sure Mongodb daemon is running (port: 27017)
- Use git gui or Webstorm -> VCS -> Version Control -> git to git mean stack from https://github.com/linnovate/mean.git
- Get into the new Webstorm project ‘mean’
- Add a new Run item ‘mean’: - Run -> Edit Configurations -> Add(+) -> Node.js:
- Name: mean - Path to Node: C:Program Filesnodejsnode.exe - Working Directory: C:…WebstormProjectsmean - Path to Node APp JS File: C:…WebstormProjectsmeanserver.js - Open the WebStorm settings(ctrl+alt+s), and then click the Command Line Tool Support.
- In the Command Line Tool Support page, click the Add button. Click Create Custom Tool dialog box (+).
-
In the Tool Settings dialog box that opens, specify the following: — Tool name and location. — The alias to use in command calls instead of the full path to the tool. — Brief explanation of the tool functionality. For example, I use git bash:
Tool Path: "C:Program Files(x86)Gitbinsh.exe" --login -i Alias: git bash Description: debug mean project - When you click OK, WebStorm brings you to the Command Line Tool Support page, where the new tool is added to the list of available tools.
- Choose from Tools -> External Tools -> git bash
-
In the ’git bash’ command line, running:
npm install //install modules in package.json bower install //install front-side angular DIs in bower.json - If both the installation succeed, then: Run -> Run ‘mean’
-
In browser: http://localhost:3000/
It should work fine, a pretty cool CRUD application by using mongodb+express+angularjs+node.
- Debug should also work correctly. For the new added data, in ‘git bash’ command line: use mongo command to access MongoDB.
This is cool to run/debug mean demo in Webstorm environment.
