 
   use GenStage
   alias Farmbot.BotState.Transport.HTTP.Router
+  alias Farmbot.System.ConfigStorage
 
   @port 27_347
 

    {:reply, {:ok, state.public_key}, [], state}
  end

  defp dispatch(Farmbot.BotState = dispatcher, events, %{sockets: sockets} = state) do
    bot_state = List.last(events)
    for socket <- sockets do
      send socket, {dispatcher, bot_state}
    end
    {:noreply, [], %{state | bot_state: bot_state}}
  end

  defp dispatch(Farmbot.Logger = dispatcher, logs, %{sockets: sockets} = state) do
    for socket <- sockets do
      send socket, {dispatcher, logs}
    end
    {:noreply, [], state}


  # 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.
  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:
