Integrating couchapp

I'm quite new to WebStorm. I would like to edit the files of a CouchaApp/CouchDB web application with webstorm and I'm trying to integrate them into the edit cycle.

Typically a CouchApp web application can be created with  predefined folders and files that are generated by a simple command: couchapp generate mydatabase (see pic1). This command generates a main folder, mydatabase, and a couple of subfolders and js, json, and text files (see pic 2, the last folder under project couchdb). These are the files and folders I want to edit with WebStorm.

In order to integrate the edited files into the CouchDB database that exists elsewhere (on the local or a remote system), you issue another command: couchapp push mydatabase (see pic3). That's it. Then, in your browser, you can navigate to your web application, i.e. locally to http://127.0.0.1:5984/mydatabase/_design/mydatabase/index.html (see pic4).

Now, I would like to link the command couchapp push mydatabase (either directly or by using a batch file) to the Run command of WebStorm, but don't yet know how. Any suggestions? At the moment I'm using an external command line window which works, but is quite cumbersome.



Attachment(s):
pic4.png
pic3.png
pic2.png
pic1.png
3 comments
Comment actions Permalink

Hello!

Usual way to run commands from IDE it is to configure External tool (File | Settings | External Tools) for it.Then you'll be able to run it from context menu.
Also, if you want to run that command before some run configuration, you can use plus in Before Launch area of run configuration, and setup your external tool to be run before it.

Best regards,
Elena Shaverdova

0
Comment actions Permalink

Thank you, Elena!

This worked! For anybody who wants to duplicate the action, the picture shows my settings.
The action can be triggered as follows: In the editor, right-click on the working area of a file and choose Push CouchApp from the context menu.

Regards,

Reinhard Engel



Attachment(s):
pic.png
0
Comment actions Permalink

Just a correction:

You have to right-click on the database folder name in the project tree and then choose Push CouchApp from the context menu.

0

Please sign in to leave a comment.