-
-
Notifications
You must be signed in to change notification settings - Fork 793
/
ApiGateway.js
37 lines (29 loc) · 837 Bytes
/
ApiGateway.js
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
import HttpServer from './HttpServer.js'
export default class ApiGateway {
constructor(service, options, config, lambda) {
this._httpServer = new HttpServer(service, options, config, lambda)
}
async start() {
await this._httpServer.start()
}
// stops the server
async stop(timeout) {
await this._httpServer.stop(timeout)
}
createRoutes(functionKey, functionObj, http) {
this._httpServer.createRoutes(functionKey, functionObj, http)
}
createResourceRoutes() {
this._httpServer.createResourceRoutes()
}
create404Route() {
this._httpServer.create404Route()
}
registerPlugins() {
return this._httpServer.registerPlugins()
}
// TEMP FIXME quick fix to expose gateway server for testing, look for better solution
getServer() {
return this._httpServer.getServer()
}
}