Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Raspberry Pi LED Blueprints

You're reading from  Raspberry Pi LED Blueprints

Product type Book
Published in Sep 2015
Publisher
ISBN-13 9781782175759
Pages 180 pages
Edition 1st Edition
Languages
Author (1):
Agus Kurniawan Agus Kurniawan
Profile icon Agus Kurniawan

Table of Contents (14) Chapters

Raspberry Pi LED Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Getting Started with LED Programming through Raspberry Pi GPIO Make Your Own Countdown Timer Make Your Own Digital Clock Display LED Dot Matrix Building Your Own Traffic Light Controller Building Your Own Light Controller-based Bluetooth Making Your Own Controlled Lamps Through Internet Network Index

Building RESTful using Node.js


After creating a simple web server, we can build a simple RESTful. REST stands for Representational State Transfer. It uses primitive HTTP operations to maintain communication between the server and the client. In this section, I implement RESTful using Express for Node.js. This library can cut your development time to build a web application.

For further information about Express, please visit http://expressjs.com. We also need body-parser to work with JSON data. JSON (JavaScript Object Notation) is a lightweight data-interchange format and easy to read and write. The following is a sample of JSON data:

{
    name: 'foo',
    email: 'foo@email.com',
    leve: 3
}

We are going to use JSON to exchange data between the server and the client.

To install Express and body-parser, you can use npm. Type the following commands:

$ npm install express
$ npm install body-parser

For testing, we build a simple RESTful app, which serves HTTP GET JSON. Create a file named myrest...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}