chu2: FFI for Chu2 Agda Web Server Interface

[ bsd3, library, web ] [ Propose Tags ]

FFI for Chu2 Agda Web Server Interface


[Skip to Readme]

Modules

[Last Documentation]

  • Chu2
    • Chu2.FFI
    • Handler
      • Chu2.Handler.SnapServerFFI
    • Interface
      • Chu2.Interface.Hack2

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 2012.11.16, 2012.11.16.1, 2012.11.17, 2012.11.17.1, 2012.11.17.2, 2012.11.18, 2012.11.18.1, 2012.11.18.2, 2012.11.19, 2012.11.20
Dependencies base (>=4 && <6), bytestring, data-default, hack2, hack2-handler-snap-server [details]
License BSD-3-Clause
Author Jinjing Wang
Maintainer Jinjing Wang <nfjinjing@gmail.com>
Category Web
Home page https://github.com/nfjinjing/chu2
Uploaded by JinjingWang at 2012-11-18T04:03:13Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 7696 total (23 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-12-23 [all 8 reports]

Readme for chu2-2012.11.18.2

[back to package description]

Chu2 Agda Web Server Interface

hello world example

module Hello where

open import IO.Primitive    using (return)
open import Data.List       using ([])
open import Chu2.ByteString using (pack)
open import Function        using (_$_; const)
open import Chu2            using (response; OK; Application) 

hello-world-response = response OK [] (pack "Hello Agda!")

hello-world-app : Application
hello-world-app = const $ return hello-world-response

open import Chu2.Handler.SnapServer using (on-port_run)
main = on-port 3000 run hello-world-app

Using Middleware

module Hello2 where

-- simple-logger middleware
open import Chu2.Middleware.SimpleLogger using (simple-logger)

open import IO.Primitive    using (return)
open import Function        using (const)
open import Chu2            using (Application; defaultResponse; RawMiddleware)

-- https://github.com/nfjinjing/gumi
open import Gumi.Light      using (_-_)

hello-world-app : Application
hello-world-app = const - return defaultResponse

open import Chu2.Handler.SnapServer using (on-port_run)
main = on-port 3001 run - simple-logger hello-world-app

Note