-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathpiqi_rpc.app.src
113 lines (104 loc) · 4 KB
/
piqi_rpc.app.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{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