MindTouch Developer Center > Deki > FAQ > Testing and Contributing > How do I...Setup an API development environment?
This tutorial provides instructions on setting up the VM to use an external dekihost and how to configure Visual Studio for Deki API development. It assumes you already have a VM up and running with SSH access. 

Step 1: Get the source

You can either get the latest and greatest code from SVN or you can use the code from any release.

Step 2: Deki Configuration

  • Take the config file from: http://wiki.opengarden.org/Deki_Wiki/Configuration, rename it to my.mindtouch.deki.startup.xml, and put it in the folder C:\mindtouch\public\dekiwiki\trunk\src\bin.
  • Edit the startup.xml file to include your database settings.
  • Modify the imagemagick lines to point to these files: 
    \trunk\src\tools\mindtouch.dekihost.setup\convert.exe
    \trunk\src\tools\mindtouch.dekihost.setup\identify.exe
  • Set the dekipath and resources paths:
    <deki-path>C:\mindtouch\public\dekiwiki\trunk\web</deki-path>
    <deki-resources-path>C:\mindtouch\public\dekiwiki\trunk\web\resources</deki-resources-path>

Step 3: Visual Studio Configuration

  • Open the MindTouchDeki.sln with Visual Studio.
  • Right click on mindtouch.deki project.
  • Click Properties.
  • Open the "Debug" tab.
  • Check "Start External Program" and point it to: mindtouch.host.exe located in C:\mindtouch\public\dekiwiki\trunk\src\bin\
  • Set the "Command line arguments to:
    apikey 32_DIGIT_API_KEY_HERE script my.mindtouch.deki.startup.xml path-prefix @api http-port 8081
    Where 32_DIGIT_API_KEY_HERE is some super secret key you set for your environment. e.g. md5(time())
  • Set the "Working Directory" to: C:\mindtouch\public\dekiwiki\trunk\src\bin\

Step 4: Redirect API requests to your Windows host

  • SSH (or use the VM console) into the VM with root access and edit: /etc/apache2/sites-available/deki (you should use vi because it's the best, but if you're new just use pico or nano)
  • Find this line:
    ProxyPass /@api http://localhost:8081 retry=1
    ProxyPassReverse /@api http://localhost:8081
    And modify so that it points to your local machine and not the VM. The best way to do this is to make sure that your VM is running in NAT mode and _not_ Bridged mode.  Then find out what the VM adapter's IP address is on your local machine and fill that in. So the new lines might look something like this:
    ProxyPass /@api http://192.168.47.1:8081 retry=1
    ProxyPassReverse /@api http://192.168.47.1:8081
    (if you want to avoid editing this file in the future due to IP changes, just create a host entry in /etc/hosts and use the host name instead)
  • Restart apache /etc/init.d/apache2 restart and you're done!
  • Edit your LocalSettings.php file in your Deki's install path and this line:
    $wgDreamServer = "http://192.168.47.1:8081"

 

Final Thoughts

Now the PHP side is running off of the VM while the API is run through VS. Run the project and start working!

Tag page
You must login to post a comment.
Powered by MindTouch Deki v.8.08.1a