Installation

Getting libev

To start using FAPWS you need to install libev. Libev is an event loop library that is used to develop event-based applications, like FAPWS.

Installation for Linux/BSD/*nix

$ wget http://dist.schmorp.de/libev/libev-3.9.tar.gz
$ tar xzf libev-3.9.tar.gz
$ cd libev-3.9
$ ./configure --prefix=/usr
$ make
$ sudo make install

Mac users

You have to install the latest version of MacPorts.

$ sudo port install libev

Installing FAPWS

As FAPWS is available via easy_install, we can simply run the following command (for Linux/BSD/*nix and Mac OS X)

$ sudo easy_install fapws

First steps

Documentation by using the obligatory "Hello World" example

#!/usr/bin/env python

import fapws._evwsgi as evwsgi
from fapws import base

def start():
	evwsgi.start('0.0.0.0', '8080') 
	evwsgi.set_base_module(base)

	def hello(environ, start_response):
		start_response('200 OK', [('Content-Type','text/html')])
		return ['hello world!!']

	evwsgi.wsgi_cb(('/hello', hello))

	evwsgi.set_debug(0)	   
	evwsgi.run()
 
if __name__ == '__main__':
	start()

Explanation of the example above

Some additional considerations about your URIs

Fork me on GitHub