hapi.app.server
Version:
A small server to serve up HAPI applications
20 lines (15 loc) • 646 B
text/coffeescript
CodeExchanger = require "../codeExchanger"
class CodeExchangerMW
configure: ({app: app, callback: callback}) ->
# loading and reading configuration variables
Config = require "#{__dirname}/../config"
Config.load()
endPoint = Config.get "endPoint"
clientId = Config.get "clientId"
secret = Config.get "appSecret"
instanceId = Config.get "instanceId"
@codeExchanger = new CodeExchanger()
@codeExchanger.init endPoint, clientId, secret, instanceId
app.use(@codeExchanger.requestsHandler())
callback()
module.exports = CodeExchangerMW