Building Web Applications with Erlang
Working with REST and Web Sockets on Yaws
Publisher: O'Reilly Media
Release Date: June 2012
Pages: 156
Read on Safari with a 10-day trial
Start your free trial now Buy on AmazonWhere’s the cart? Now you can get everything on Safari. To purchase books, visit Amazon or your favorite retailer. Questions? See our FAQ or contact customer service:
1-800-889-8969 / 707-827-7019
support@oreilly.com
Why choose Erlang for web applications? Discover the answer hands-on by building a simple web service with this book. If you’re an experienced web developer who knows basic Erlang, you’ll learn how to work with REST, dynamic content, web sockets, and concurrency through several examples. In the process, you’ll see first-hand that Erlang is ideal for building business-critical services.
Erlang was designed for fault-tolerant, non-stop telecom systems, and building applications with it requires a large set of skills. By the end of the book, you’ll have the information you need to build a basic web service and get it running.
- Explore the power of Erlang and REST for building web services
- Serve static and dynamic content with the Yaws web server
- Use different methods for outputting data to user, such as encoding Erlang data structures into JSON or XML
- Build an application to listen for HTTP requests, process them, store data, and return useful data
- Go beyond the request-response model—push data to clients with web sockets
- Use Erlang and Yaws to stream data from the server to a client
"A book which is truly needed and will help get Erlang to the next level."
—Francesco Cesarini, CEO of Erlang Solutions, author of Erlang Programming.
Table of Contents
-
Chapter 1 Building Scalable Systems with Erlang and REST
-
Why Erlang?
-
Why Web Services? Why REST?
-
New Opportunities for Scaling and Resilience
-
-
Chapter 2 Getting Started with Yaws
-
Working with Yaws
-
Dynamic Content in Yaws
-
Templates
-
Logging
-
-
Chapter 3 Appmods: Dynamic Content in Yaws
-
Appmod Configuration
-
When the URI Does Not Correspond to a File
-
Cookies
-
Session Handling
-
Access Control
-
Interacting with Erlang Services and Business Logic Layers
-
-
Chapter 4 Implementing REST
-
Decoding a Request
-
Response and Headers
-
Building the Response
-
Responding to the REST Request
-
A Full Example
-
-
Chapter 5 File Upload
-
The File Upload Request
-
Saving to Disk
-
Putting It All Together
-
Storage in a Distributed System
-
Saving to Amazon S3
-
-
Chapter 6 WebSockets
-
The WebSocket Request
-
Basic WebSocket Handler
-
Advanced WebSocket Handler
-
-
Chapter 7 Streaming
-
Simple Streaming
-
-
Chapter 8 Using the HTTP Client
-
Making a Request
-
Using OAuth
-
-
Chapter 9 Building an Application with OTP
-
Directory Structure
-
Building an Application Server
-
The Generic Server
-
The Multicast Server
-
Interfacing the Server with the Web
-
Some Client-Side Code
-
Let’s Have Some Adult Supervision Around Here!
-
A Little Optimization
-
Bundling as an Application
-
The App File
-
Wrapping Up OTP
-
-
Appendix Installing Erlang and Yaws
-
Appendix Beyond Yaws
-
Web Servers
-
Web Frameworks
-
-
Appendix Interfacing with Ruby and Python
-
Ruby
-
Python
-
-
Appendix Using Erlang with Emacs
-
Distel
-
Flymake Mode
-
Gen Server Template
-