What is Happstack?
Happstack is a Haskell web framework. Happstack is designed so that developers can prototype quickly, deploy painlessly, scale massively, operate reliably, and change easily. It supports GNU/Linux, OS X, FreeBSD, and Windows environments.
RAM Cloud Database Architecture
Happstack's RAM cloud database architecture provides you the speed and predictability of RAM based queries combined with the durability, replication, and ACID properties of traditional databases. This architecture provides you with fast, predictable query times with out the uncertainly of cache misses. It simplifies your development because it is built around Haskell datatypes and functions. This means you do not need to learn a specialized query language. You also do not have to worry about database denormalization, data marshaling, SQL-injection attacks, etc. Nor do you have to worry about installing, tuning, configuring, and upgrading a caching layer such as memcached or database servers.
Happstack can also be used with existing databases such as MySQL, Postgres, Casandra, CouchDB, etc. if that better suits your needs.
Integrated HTTP Server
Happstack includes an fast, secure, integrated HTTP server. This means you do not need to install, maintain, and configure a separate HTTP server such as Apache. Because the server is integrated into your application, you also have opportunity for your application to automatic adjust and tune the parameters at run-time.
Flexible Routing and Request Processing DSL
Happstack provides a flexible system for mapping URIs to handlers, processing the QUERY_STRING and request body, and generating responses.
Flexible Templating Options
Happstack does not force you to use any particular templating or HTML generation solution. Each organization and project has different needs and a one size fits all approach can not satisfy everyone. Instead Happstack provides integration with a variety of templating solutions to meet different needs. This includies HSP, HStringTemplate, hamlet, BlazeHTML (soon) and more! It is easy to add additional 3rd party or custom options as well. A discussion of options can be found here.
Type-Safety
Happstack includes a number of optional features which can increase the type safety of your web application. This means greater assurance that your site is free from broken URLs, SQL and javascript injection attacks, missing form fields, etc. This includes technology such as web-routes for type-safe URL routing and formlets for type-safe form processing.
Getting Started
The fastest way to get started is to install happstack from hackage using cabal.
$ export PATH=~/.cabal/bin:$PATH
$ cabal update
$ cabal install happstack
Simple App
Here is a simple app to test out your installation. The application will run on port 8000 by default. If you are reading this website on the same machine you are running the app on, just click here to see it.
module Main where
import Happstack.Server
main = simpleHTTP nullConf $ ok "Hello, World!"