After a few hours of messing around, I managed to make the Cloud9 IDE for my purposes. This is a little tricky, but here is what I did:
Register on c9.io and create a workspace. There is a terminal in the workspace that I used to configure the GoogleAppEngine SDK. Check which version of the SDK we need:
$ uname -a
Download the Google AppEngine SDK for Go and unzip it
$ wget http://googleappengine.googlecode.com/files/go_appengine_sdk_linux_amd64-1.7.7.zip $ unzip go_appengine_sdk_linux_amd64-1.7.7.zip
The Cloud9 IDEs are Python 2.6.6 by default, but the Google App Engine requires at least 2.7, so we need to update it.
$~/c9-c9pm-8ef422e/packages/python27-2.7.3/install.sh
The next problem is that the Go AppEngine SDK development server is tied to the local host, but the Cloud9 IDE prohibits this. Instead, they want you to bind what is in the $ IP and $ PORT environment variables. Since the dev server is Python, nothing prevents you from changing this. Directly on Cloud9, open google_appengine/google/appengine/tools/devappserver2/devappserver2.py , go to line 653 and change this section as follows:
options = PARSER.parse_args() options.host = os.environ['IP'] dev_server = DevelopmentServer()
I could not find the second port for the admin server, so I just commented it so that it shuts up - the same file, line 632 and the following:
# admin = admin_server.AdminServer(options.admin_host, options.admin_port,
And then 621:
apis = api_server.APIServer(os.environ['IP'], options.api_port, configuration.app_id)
Now you can start the test server without crashing it. But before you do this, create a new myapp folder (or something that makes you happy) and copy it to the Go hello world app . Start the dev server with:
google_appengine/dev_appserver.py myapp/
Your server is now running, but the Cloud9 Preview window is still not properly connected to it. I had to try running Apache:
- Click the arrow to the right of the Run button in the menu bar.
- Customization
- In the left pane, select a file.
- Select Apache + PHP from the drop-down menu.
- Click Run.
This should fail because your Go dev server is already running on the IP / Port Apache you want to bind to. But you still didn’t want to use it - your preview window is now connected and should show Hello, World!
I agree that these are pretty hacks - I will try to improve the process to make it smoother, but at least it works :)