@fabernovel/heart-api
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

Description

Heart API is a runner module of Heart, which exposes an HTTP API that starts an analysis when it is requested.

Note that you must install an analysis module too, to have a minimum viable installation of Heart.

Read more about the description and design of Heart.

Usage

  1. Install the package and an analysis module, for example Heart GreenIT

    npm install @fabernovel/heart-api @fabernovel/heart-greenit

    If you are using Yarn, npm < 7 or PNPM < 8, you also have to install Heart CLI (which is automatically installed in more recent versions of these packages managers):

    npm install @fabernovel/heart-cli
  2. Start the server

    npx heart api

    You now have an HTTP server listening to 127.0.0.1:3000, with a /greenit endpoint where you could POST your analysis configuration (JSON-formatted) to start an analysis.

    You can change the default port with the --port option, and specify HTTP CORS headers with the --cors one.

  3. Start an analysis

    POST /greenit
    Content-type: application/json
    {
      "config": {
        "url": "https://www.fabernovel.com"
      }
    }

    The analysis configuration set with the request's body follows the JSON format, and depends of the analysis module; read their README.

Readme

Keywords

none

Package Sidebar

Install

npm i @fabernovel/heart-api

Weekly Downloads

5

Version

4.0.0

License

MIT

Unpacked Size

9.98 kB

Total Files

11

Last publish

Collaborators

  • thomasgiscos
  • gautierb
  • williamgoulois
  • cezarion
  • bastien.gatellier.fabernovel
  • arnaud.mombrial.npmjs
  • victorchabbert