<reponame>ricardotulio/skynet<filename>app/main.js<gh_stars>0
import env from 'node-env-file'
import restify from 'restify'
import { path } from 'ramda'
import { basePath } from '../config/paths'
import botBuilder from './botBuilder'

env(`${basePath()}/.env`)

const credentials = {
  appId: process.env.MICROSOFT_APP_ID,
  appPassword: <PASSWORD>.<PASSWORD>,
}

const bot = botBuilder.build(credentials)

const connector = path(['connectors', '*'], bot)

const server = restify.createServer()
server.listen(process.env.PORT || 3000, () => {
  console.log('%s listening on %s', server.name, server.url)
})

server.post('/v1/messages', connector.listen())
