Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
114 lines (104 sloc) 4 KB
{application, piqi_rpc, [
{description, "Piqi-RPC -- JSON/XML/Protobuf over plain HTTP RPC system for Erlang"},
{vsn, git},
{modules, []},
{registered, [piqi_rpc_monitor, piqi_rpc_sup]},
{applications, [
kernel,stdlib,
piqi,
crypto, mochiweb, % XXX: do we really need to specify these?
webmachine
]},
{mod, {piqi_rpc_app, []}},
{env, [
% The list of Piqi-RPC services definitions, where each entry has the
% following format:
%
% {ImplMod, RpcMod, UrlPath}
%
% or
%
% {ImplMod, RpcMod, UrlPath, Options}
%
% , where
%
% `ImplMod` contains implementation of the RPC service defined in
% `RpcMod`.
%
% `RpcMod` is a module generated by "piqic-erlang-rpc" command from a
% Piqi specification. The module is usually named as "<smth>_piqi_rpc".
%
% `UrlPath` is a base URL path of the HTTP resource for the RPC service.
% For example, if the URL path is set to "bar/foo", then the RPC service
% will be available at "http://<server>:<port>/bar/foo"
%
% `Options` is a list of service options, see the
% `default_service_option` configuration entry below for details.
%
% Examples:
%
% {foo_impl, foo_piqi_rpc, "bar/foo"}
%
% {foo_impl, foo_piqi_rpc, "bar/debug_foo", [
% {pretty_print, true},
% {use_strict_parsing, true}
% ]}
%
% {foo_impl, foo_piqi_rpc, "bar/production_foo", [
% {pretty_print, false},
% {omit_internal_error_details, true}
% ]}
%
{rpc_services, []},
% default options for Piqi-RPC servieces; they can be overridden by
% options defined for individual services
{default_service_option, [
% pretty-print JSON and XML output (default = true)
%{'pretty_print', true}
%
% omit fields with 'null' and '[]' values from JSON output (default = true)
%{'json_omit_missing_fields', true}
%
% treat unknown and duplicate fields as errors when parsing JSON or
% XML input (default = false)
%{'use_strict_parsing', false}
%
% do not include Erlang stracktraces in HTTP 500 responses when
% request handler crashes (default = true)
%{'omit_internal_error_details', true}
]},
% HTTP server configuration containing both Mochiweb and Webmachine
% options. These options are passed to Webmachine by calling
% `mochiweb_webmachine:start/1` which parses Webmachine-specific options
% and passes the rest of them to `mochiweb_http:start/1`.
{http_server, [
% Network interface to listen at; determined by IP address of the
% interface or 'any' for all interfaces
{ip, 'any'},
% Mochiweb HTTP server port
{port, 8888},
% TCP connection listen backlog (default = 128)
% {backlog, 128},
%
% Acceptor pool size (default = 16)
% {acceptor_pool_size, 16},
% XXX: what about ssl?
% Webmachine options:
%
% NOTE: there's no default for the log directory so it must be
% defined if at least one of the loggers is enabled
% {log_dir, "piqi_rpc_log"},
%
% NOTE: these two options will interfere with other Webmachine
% application, use it with extra care or only for testing
%
% write "access.log" using Webmachine's default logger
% {enable_access_logger, true},
%
% {enable_perf_logger, true},
% Erlang local name for the HTTP server
{name, piqi_rpc_mochiweb}
]}
]}
]}.
% ex: ft=erlang