Repository navigation
Expand file tree
/
Copy pathconfig.yml
More file actions
52 lines (46 loc) · 1.41 KB
/
Copy pathconfig.yml
File metadata and controls
52 lines (46 loc) · 1.41 KB
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
app-name: "Node.js test service"
# this section describes the server logic provided by the application
# it consists of server and its endpoints definitions
servers:
# a name of the server inside the application
my-http-server:
hosts:
- ${HTTP_HOST:"127.0.0.1"}
port: ${LISTEN_PORT: 8080}
protocol: "http"
endpoints:
# a name of the endpoint, for example this one serves static content
serve-static:
location: "/"
methods:
get:
# the name of the function which handles the requests to the endpoint
handler: "serveStatic"
# an example of the endpoint which accepts requests with several methods
session:
location: "/session"
methods:
get:
handler: "newSession"
post:
handler: "validateSession"
delete:
handler: "deleteSession"
# this endpoint demonstrates the usage of an external resource
events:
location: "/events"
methods:
post:
handler: "callService"
# this section describes the usage of external resources
# by defining the endpoints to call and how to handle the results
clients:
external-api:
type: "web"
url: "http://localhost/session"
port: ${LISTEN_PORT:8080}
methods:
get:
input: "googleApiRequest"
success: "onGoogleGetResult"
fail: "onGoogleError"