Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Building Web Applications with Erlang
Preface
Who This Book Is For
Learning Erlang
Before You Start
What You Will Learn
The Limits of This Book
Help! It Doesn’t Compile or Run!
Diagnosing the Error
What Version of Erlang and Yaws Are You Running?
Is Everything Loaded Correctly?
Are You Calling Everything Correctly?
Is Mnesia Running with Correct Tables?
Is the Example Just Plain Wrong?
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
Acknowledgments
1. Building Scalable Systems with Erlang and REST
Why Erlang?
Erlang’s Advantages
Lack of Types
OTP—For More Than Just Telecom!
Why Web Services? Why REST?
New Opportunities for Scaling and Resilience
Cloud Computing
System Architecture and Erlang Scaling
Scaling up versus scaling out
Amdahl’s law
Data Storage Options
Mnesia
CouchDB
MongoDB
Redis
Riak
2. Getting Started with Yaws
Working with Yaws
Starting Yaws
Serving Static Files
Compiling, Loading, and Running Code
Clustering Yaws
Dynamic Content in Yaws
EHTML
Headers and Redirects
Templates
ErlyDTL
Logging
Erlang OTP error_logger
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
4. Implementing REST
Decoding a Request
Extracting the User’s Request
Response and Headers
Building the Response
JSON
XML
Responding to the REST Request
A Full Example
5. File Upload
The File Upload Request
Saving to Disk
Putting It All Together
Storage in a Distributed System
Saving to Amazon S3
6. WebSockets
The WebSocket Request
Basic WebSocket Handler
Advanced WebSocket Handler
7. Streaming
Simple Streaming
8. Using the HTTP Client
Making a Request
Using OAuth
Facebook Canvas
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
A. Installing Erlang and Yaws
B. Beyond Yaws
Web Servers
Cowboy
MochiWeb
Misultin
Web Frameworks
Chicago Boss
Nitrogen
Zotonic
C. Interfacing with Ruby and Python
Ruby
Python
D. Using Erlang with Emacs
Distel
Flymake Mode
Gen Server Template
About the Author
Copyright
← Prev
Back
Next →
← Prev
Back
Next →