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

Fapws3 has been reported to run with libev-3.8, 3.9, 4.0 and 4.1.
$ wget http://dist.schmorp.de/libev/Attic/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 fapws3

Alternatively, you can grab it from github:

$ wget --no-check-certificate http://github.com/william-os4y/fapws3/tarball/master -O fapws3.tgz
$ tar xzf fapws3.tgz
$ cd william-os4y-fapws3*
$ python setup.py build
$ sudo python setup.py install

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