Install Google Coder on Ubuntu / Debian / Raspbian
Small article to talk about Google Coder. This little project that allows you to learn to code on a Raspberry Pi is really screwed up. Entirely written in javascript it clearly demonstrates the speed of node.js for web applications. For my part, I use it to learn how to manipulate CSS and HTML5 tags. On the server side, I stay on python and Django. In short, if you don't want to format your raspberry just for that, you can install Coder on Ubuntu or Debian. You can also follow this procedure to install it on your RPI (on raspbian) without reinstalling the system as required by the official installation.
In this section:
Prerequisites
Node.js
On ubuntu installing node.js and the npm library management tool is easy:
1
|
apt–get install nodejs npm
|
On the other hand on Debian it is necessary to install the backport repositories before
1
2
3
|
echo « deb http://ftp.us.debian.org/debian wheezy-backports main » >> /etc/apt/sources.list
apt–get update
apt–get install nodejs
|
Make a symbolic link from nodejs to node
ln -s / usr / bin / nodejs / usr / local / bin / node
Check the installation
1
|
node –v
|
NPM
We get the script and we install on the fly
1
|
curl https://npmjs.org/install.sh | sudo sh
|
Verification
1
|
npm –v
|
Installing Google Coder
Source recovery
1
|
git clone https://github.com/googlecreativelab/coder
|
We place ourselves in the file and we install the necessary libraries
1
2
|
cd coder–base
npm install
|
Installing applications in coder
1
2
|
cd coder–apps
sh install_common.sh ../coder–base/
|
The application needs a “pi” user
1
|
useradd –m pi
|
Start coding
1
2
|
cd coder–base
npm start
|
The application is then available at the address of the machine that hosts all this. To modify the listening port you can modify the coder-base / config.js file. Here is mine:
1
2
3
4
5
6
|
exports.listenIP = null; //Defaults to *
exports.listenPort = ‘8083’; //the SSL port things run on
exports.httpListenPort = ‘8084’; //this will all be redirected to SSL
exports.cacheApps = true;
exports.httpVisiblePort = ‘8084’; //forwarded http port the user sees
exports.httpsVisiblePort = ‘8083’; //forwarded https port the user sees
|