Book Image

Intel Galileo Blueprints

By : Marco Schwartz
Book Image

Intel Galileo Blueprints

By: Marco Schwartz

Overview of this book

Table of Contents (19 chapters)
Intel Galileo Blueprints
About the Author
About the Reviewers
Free Chapter
Setting Up the Galileo Board and the Development Environment

Building the home automation interface

Now, we are ready to build the app that will facilitate the communication between the Galileo and Arduino boards.

We will use the same technique that we used in the previous chapter. We make use of the Node.js server to build a scalable network application, the Jade interface to manage interactions, and finally, JavaScript to link both.

Here is the first main.js file:

// Module
var express = require('express');
var app = express();

// Define port
var port = 3000;

// View engine
app.set('view engine', 'jade');
app.set('views', __dirname + '/views');

// Set public folder
app.use(express.static(__dirname + '/public'));

// Serve interface
app.get('/', function(req, res){

// Rest
var rest = require("arest")(app);

// Add devices

// Start server
console.log("Listening on port " + port);

We will use the Express framework for this...