# Feedbot Server

This app exposes API for retrieval and updating of stored JSON bot definitions from table storage.

## Example calls

* `GET` http://localhost:8000/api/bots
* `GET` http://localhost:8000/api/bots/eop
* `POST` http://localhost:8000/api/bots `{bot:{...}}`
* `PUT` http://localhost:8000/api/bots/eop `{bot:{...}}`

Bot object structure is defined in `feedbot/packages/schema` package.

## Authentication

Following environment variables can be used to enable Facebook authentication:

* `FACEBOOK_APP_ID`
* `FACEBOOK_APP_SECRET`
* `REALTIME_SERVER_URL` - where realtime server is running
* `REALTIME_NAMESPACE` - namespace of designer (prefix of botId)

Header `Authorization: Bearer *` is then checked against Facebook Graph API before every API call hander execution.

## Design

REST calls are described in `server/handlers/...` and their services are respectively placed in `server/data/...` directory.