phoenix_microsoftbot

所属分类:处理器开发
开发工具:Elixir
文件大小:9KB
下载次数:0
上传日期:2016-12-22 11:19:54
上 传 者sh-1993
说明:  用于创建Microsoft Bot连接器端点的Phoenix控制器
(Phoenix controller for creating the endpoint for Microsoft Bot connectors)

文件列表:
.travis.yml (222, 2016-12-22)
LICENSE.md (1068, 2016-12-22)
config (0, 2016-12-22)
config\config.exs (1143, 2016-12-22)
lib (0, 2016-12-22)
lib\microsoftbot_callback.ex (290, 2016-12-22)
lib\microsoftbot_phoenix_controller.ex (1135, 2016-12-22)
lib\microsoftbot_responder.ex (333, 2016-12-22)
lib\microsoftbot_router.ex (1743, 2016-12-22)
mix.exs (1369, 2016-12-22)
mix.lock (4314, 2016-12-22)
test (0, 2016-12-22)
test\phoenix_microsoftbot_test.exs (140, 2016-12-22)
test\test_helper.exs (15, 2016-12-22)

[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/zabirauf/phoenix_microsoftbot/master/LICENSE.md) [![hex.pm version](https://img.shields.io/hexpm/v/phoenix_microsoftbot.svg?style=flat)](https://hex.pm/packages/phoenix_microsoftbot) [![Build Status](https://travis-ci.org/zabirauf/phoenix_microsoftbot.svg?branch=master)](https://travis-ci.org/zabirauf/phoenix_microsoftbot) [![Inline docs](http://inch-ci.org/github/zabirauf/phoenix_microsoftbot.svg)](http://inch-ci.org/github/zabirauf/phoenix_microsoftbot) Made with Spacemacs # Phoenix Microsoft Bot This library allows for easy creation of the web API that the Microsoft bot framework can connect to. ## Documentation API documentation is available at [https://hexdocs.pm/phoenix_microsoftbot](https://hexdocs.pm/phoenix_microsoftbot) ## Installation 1. Add ex_microsoftbot to your list of dependencies in `mix.exs`: def deps do [{:phoenix_microsoftbot, "~> 1.0.0"}] end ## Usage To create the Web API for Microsoft Bot Framework to connect to requires three steps 1. Defining the controller ``` defmodule MessageController do use MicrosoftBot.Phoenix.Controller def message_received(%MicrosoftBot.Models.Message{} = message) do # ... # send message back or resp(conn, 200, "") end end ``` 2. In the `routes.ex` ``` defmodule YourApp.Router do use YourApp.Web, :router # Add the following two lines use MicrosoftBot.Router microsoftbot_routes "/api/message", MessageController end ``` 3. Add `:microsoftbot` configuration in `prod.exs` ``` config :microsoftbot, app_id: "APP_ID", app_secret: "APP_SECRET" ```

近期下载者

相关文件


收藏者