@hackage mellon-web0.8.0.7

A REST web service for Mellon controllers

  • Installation

  • Tested Compilers

  • Dependencies (26)

  • Dependents (0)

  • Package Flags

      client-unlock-example
       (on by default)

      Build the unlock client example

      enable-timing-sensitive-tests
       (off by default)

      Enable tests that are timing-sensitive (may fail on loaded machines like CI servers)

      gpio-example
       (on by default)

      Build the GPIO server example

      mock-example
       (on by default)

      Build the mock server example

      test-doctests
       (on by default)

      Build doctests

      test-hlint
       (off by default)

      Build hlint test

The mellon-web package wraps a mellon-core controller in a REST web service, making it possible to control physical access devices from an HTTP client. The package includes both a WAI application server, and native Haskell client bindings for the service.

Like the mellon-core controller interface, the mellon-web REST API is quite simple. There are only 3 methods:

  • GET /time returns the system time on the server. This is made available for diagnostic purposes, primarily to ensure the server has an accurate clock.

  • GET /state returns the controller's current state (either Locked or Unlocked date where date is the UTC time at which the controller will automatically lock again).

  • PUT /state sets the controller's current state. Use this method to lock and unlock the controller.

For detailed documentation, the server includes a self-documenting Swagger spec.

Note that the mellon-web server does not provide an authentication mechanism! You should proxy it behind a secure, authenticating HTTPS server such as Nginx.