Giter Site home page Giter Site logo

clova-cek-sdk-elixir's Introduction

Clova

A behaviour and related modules for implementing a Clova Extension.

Summary

Defines a Clova behaviour which can be implemented to receive callbacks to handle requests. Plug should be used to parse the request, validate it, and dispatch it to the Clova implementation.

Example Plug.Router pipeline:

plug Clova.SkillPlug,
  dispatch_to: MyExtension,
  app_id: "com.example.my_extension",
  json_module: Poison

plug :match
plug :dispatch

post "/endpoint" do
  send_resp(conn)
end

Example Clova implementation for a Hello World extension:

defmodule MyExtension do
  use Clova

  def handle_launch(_request, response) do
    response
    |> add_speech("ハロー、ワールド!")
    |> end_session
  end
end

For a more detailed example, see the AirQuality example extension.

Installation

Add :clova to your mix.exs dependencies. This package assumes you will be using Plug - see the Plug documentation for setting up a Plug application.

  defp deps do
    [
      {:clova, "~> 0.5.0"},
      {:plug, "~> 1.6"},
      {:cowboy, "~> 2.2"},
      # You can use whichever JSON library you prefer
      {:poison, "~> 3.1"}
    ]
  end

Online Documentation

Full documentation is available on HexDocs.

clova-cek-sdk-elixir's People

Contributors

adamu avatar syleeeee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

syleeeee adamu

clova-cek-sdk-elixir's Issues

ValidatorPlug crashes when request is empty.

Request: POST /clova
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in Clova.Request.get_application_id/1
        (clova) lib/clova/request.ex:24: Clova.Request.get_application_id(%{})
        (clova) lib/clova/validator_plug.ex:60: Clova.ValidatorPlug.call/2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.