
PhoneGap By Example
By :

Let's plan our first REST API. With Express, it is very easy and the development itself does not really differ from website development.
Here is a summary of what we want to implement as a REST API:
Resource (URI) |
POST (create) |
GET (read) |
PUT (update) |
DELETE (destroy) |
---|---|---|---|---|
|
Create new picture |
List pictures |
N/A (update all) |
N/A (destroy all) |
|
Error |
Show picture ID 1 |
Update picture ID 1 |
Destroy picture ID 1 |
Building a REST API is pretty popular in the Node.js community. There are a lot of different ways to handle such a task. There are even ready-to-use modules such as rest.js
or restify
. However, we will use another framework called Express
.
Express is a web application framework for Node.js. With Express, we can build websites as well...
Change the font size
Change margin width
Change background colour