Skip to content

Utility functions for implementing services as Yaws appmods.

License

Notifications You must be signed in to change notification settings

erisata/yaws_cage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The yaws_cage application

This application provides various utility functions for implementing services as http://yaws.hyber.org/ appmods.

The approach for implementing REST services is taken from http://www.infoq.com/articles/vinoski-erlang-rest. Example usage of yaws_cage_rest module:

-module(my_rest).
-behaviour(yaws_cage_rest).
-export([out/1, handle_request/4]).
-include_lib("yaws/include/yaws_api.hrl").

out(Arg) ->
    yaws_cage_rest:out(?MODULE, Arg, _Opts = []).

handle_request(["check"], 'GET', _Arg, _Opts) ->
    {content, 200, <<"ok!">>};
handle_request(Path, _Method, Arg, Opts) ->
    yaws_cage_rest:handle_unsupported(?MODULE, Path, Arg, Opts).

Modules

yaws_cage_logger
yaws_cage_rest
yaws_cage_test

About

Utility functions for implementing services as Yaws appmods.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published