 
   # Accessing the API
   A developer should be able to access the REST API at
-  `http://<my_farmbot_id>:27347/api/v1/`. The calls will require an authentication token.
+  `http://<my_farmbot_id>:27347/api/v1/`.
+  The calls will require an authentication token.
   See the [API docs](https://github.com/farmbot/Farmbot-Web-App#q-how-can-i-generate-an-api-token)
   for information about generating a token. Access to the local api should be
   the same as accessing the cloud API. You will need to have an HTTP header:


  use GenStage
  alias Farmbot.BotState.Transport.HTTP.Router

  @port 27_347


  end

  def init([]) do
    s = ConfigStorage.get_config_value(:string, "authorization", "server")
    req = {'#{s}/api/public_key', []}
    {:ok, {_, _, body}} = :httpc.request(:get, req, [], [body_format: :binary])
    public_key = body |> JOSE.JWK.from_pem
    # FIXME(Connor) The router should probably
    # be put in an externally supervised module..
    opts = [port: @port, acceptors: 2, dispatch: [cowboy_dispatch()]]
    case Plug.Adapters.Cowboy.http Router, [], opts do
      {:ok, web} ->
        state = %{web: web, bot_state: nil, sockets: [], public_key: public_key}
        Process.link(state.web)
