Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Decouple HTTP Servers from cli/commands/daemon #1950

Merged
merged 4 commits into from
Apr 12, 2019

Commits on Apr 11, 2019

  1. refactor: decouple HttpApi from cli/commands/daemon

    In the past API was exposed via HTTP Server only when jsipfs daemon was run
    from the commandline, so src/http/index.js was also responsible for
    orchestration that is not related to HTTP itself.
    
    This refactor moves code that is not related to HTTP Servers into
    standalone-daemon.js, which is easier to reason about, and unlocks use
    of HttpApi in contexts other than commandline jsipfs daemon,
    such as Firefox with libdweb or Chromium-based web browser with chrome.sockets APIs.
    
    Refs.
    ipfs/ipfs-companion#664
    
    License: MIT
    Signed-off-by: Marcin Rataj <lidel@lidel.org>
    lidel committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    a3e0bd4 View commit details
    Browse the repository at this point in the history
  2. fix: print HTTP listeners only when run as daemon

    This changes behavior in web browser. Instead of printing to
    console.log, it uses proper debug-based logger.
    
    Old behavior in terminal (when run via `jsipfs daemon`) does not change.
    
    License: MIT
    Signed-off-by: Marcin Rataj <lidel@lidel.org>
    lidel committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    0b9076d View commit details
    Browse the repository at this point in the history
  3. test: use StandaloneDaemon in test/http-api,gateway

    This replaces durect use of HttpApi with StandaloneDaemon, restoring all
    existing tests to operational state.
    
    License: MIT
    Signed-off-by: Marcin Rataj <lidel@lidel.org>
    lidel committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    7c32da8 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2019

  1. refactor: rename StandaloneDaemon to Daemon

    License: MIT
    Signed-off-by: Marcin Rataj <lidel@lidel.org>
    lidel committed Apr 12, 2019
    Configuration menu
    Copy the full SHA
    1e82102 View commit details
    Browse the repository at this point in the history