Book Image

CoffeeScript Application Development Cookbook

By : Mike Hatfield
Book Image

CoffeeScript Application Development Cookbook

By: Mike Hatfield

Overview of this book

Table of Contents (18 chapters)
CoffeeScript Application Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating RESTful web services


In this collection of recipes, we will create a simple HTTP server using Node and a popular web application called express. Express is a Node package used to create small web applications. It provides support to map HTTP verbs to URL paths, which makes it ideal to set up a quick HTTP server to host an API.

In this section, we will look at managing our application's dependencies as well as building a simple HTTP server and a web API using express.

Managing dependencies with package.json

Nearly all but the extremely simple applications will require one or more external dependencies. Typically, these are NPM modules. In this section, we will look at using a package configuration file. This allows us to configure or project and manage dependencies.

Getting ready

We can create a package.json file by using NPM. Enter the following command in your terminal or command window:

npm init

How to do it...

The npm init command will present you with a series of questions and some...