-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsxapi.yml
165 lines (165 loc) · 5.53 KB
/
sxapi.yml
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: sxapi-default-testing
description: sxapi testing microservice API ({{{NODE_ENV}}}). You can find out more at http://startx.fr/api
termsOfService: http://startx.fr/api#termOfService
contactName: Dev STARTX
contactMail: dev@startx.fr
licence: GPL v2.0
version: 0.0.1
debug: "{{{SX_DEBUG}}}"
session:
duration: 3600
auto_create: true
transport:
type: cookie
cookie_name: sxapi-sess
backend:
type: memory
sid_field: token_sess
fields:
stop: datefin_sess
resources:
serviceinfo-sample:
_class: serviceinfo
swagger-sample:
_class: swagger
websocket-sample:
_class: websocket-client
host: http://localhost:{{{APP_PORT}}}
s3-sample:
_class: aws_s3
listObjects_options: {}
getObject_options: {}
addObject_options: {}
updateObject_options: {}
deleteObject_options: {}
ACCESS_ID: XXXXXXXXXXXXX
ACCESS_KEY: XXXXXXXXXXXXX
SESSION_TOKEN: ''
region: eu-west-3
Bucket: sxapiexample
log:
filters:
level: '0,1,2,3,4,5'
type: "{{#SX_DEBUG}}debug,{{/SX_DEBUG}}info,error,warn"
server:
port: '{{{APP_PORT}}}'
static:
- path: "/test"
dir: "/test"
enableWebsockets: true
websockets:
events:
- event: example
handler: "$ws.websockets.onMessageDefaultCallback"
- event: exampleGlobal
handler: "$ws.lib.mySocketEndpointFunction"
- event: disconnect
handler: "$ws.websockets.onMessageDefaultCallback"
endpoints:
- path: "/"
description: Display welcome message (HTML)
body:
- "<html>"
- "<head><title>Application {{name}}</title></head>"
- <link rel="stylesheet" href="https://goo.gl/4kFNLH">
- <body><div class="container">
- <h1><span class="glyphicon glyphicon-eye-open"></span> Your API {{name}} is
live !</h1>
- <div class="alert alert-success" role="alert"><p>This API is {{description}}
running on <b>{{hostname}}</b> with current release <b>v{{version}}</b></p></div>
- <div class="alert alert-info" role="alert"><p>The application signature is <b>{{appsign}}</b>
and corespond to a blank project.</p></div>
- "<p>Default config file must be changed and replaced your <b>own sxapi.yml</b>
config file."
- You will then be able to build your own API resources and endpoints.<br>
- For more informations please visit <a href="https://github.com/startxfr/sxapi-core"
target="">sxapi project documentation</a>.</p>
- <nav class="navbar navbar-default navbar-fixed-bottom"><div class="container">
Microservice engine is <b>{{package.name}} v{{package.version}}</b>. {{package.description}}</div></nav>
- "</div></body>"
- "</html>"
- path: "/health"
description: Return health check for this API instance
resource: serviceinfo-sample
endpoint: health
- path: "/info"
description: Return information about this API instance
resource: serviceinfo-sample
endpoint: info
- path: "/swagger"
resource: swagger-sample
description: Return a swagger manifest for this API
endpoint: manifest
- path: "/ping"
description: Ping the application. Return a sample message in json
code: '200'
body: pong
- path: "/function"
description: Test and dedicated function. Return a sample message in json
handler: "$ws.dynamicRequestHandlerTest"
- path: "/s3/store"
description: Abstract path for file storage sub-path
method: ROUTER
resource: s3-sample
endpoints:
- path: "/s3/store"
description: List all objects from a fixed bucket in the S3 resource
method: GET
endpoint: listObjects
Bucket: sxapiexample
- path: "/s3/store/:id"
description: Read an object from a fixed bucket in the S3 resource
method: GET
endpoint: getObject
Bucket: sxapiexample
- path: "/s3/store/:id"
description: Create an object in a fixed bucket into the S3 resource
method: POST
endpoint: addObject
Bucket: sxapiexample
- path: "/s3/store/:id"
description: Update an object in a fixed bucket into the S3 resource
method: PUT
endpoint: addObject
Bucket: sxapiexample
- path: "/s3/store/:id"
description: Delete an object in a fixed bucket into the S3 resource
method: DELETE
endpoint: deleteObject
Bucket: sxapiexample
- path: "/s3/stores/:bid"
description: List all objects from a given bucket in the S3 resource
method: GET
endpoint: listObjects
- path: "/s3/stores/:bid/:id"
description: Read an object from a given bucket in the S3 resource
method: GET
endpoint: getObject
- path: "/s3/stores/:bid/:id"
description: Create an object in a given bucket into the S3 resource
method: POST
endpoint: addObject
- path: "/s3/stores/:bid/:id"
description: Update an object in a given bucket into the S3 resource
method: PUT
endpoint: addObject
- path: "/s3/stores/:bid/:id"
description: Delete an object in a given bucket into the S3 resource
method: DELETE
endpoint: deleteObject
- path: "/s3/buckets"
description: List all available buckets from a given bucket in the S3 resource
method: GET
endpoint: listBuckets
- path: "/s3/buckets/:id"
description: Create a new bucket in the S3 resource
method: POST
endpoint: addBucket
- path: "/s3/buckets/:id"
description: Read bucket info from the S3 resource
method: GET
endpoint: infoBucket
- path: "/s3/buckets/:id"
description: Delete a bucket in the S3 resource
method: DELETE
endpoint: deleteBucket