Skip to content

value-enabled-web/vew-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 23, 2023
81807a3 Β· Jan 23, 2023

History

17 Commits
Dec 20, 2022
Nov 17, 2022
Dec 20, 2022
Nov 14, 2022
Nov 7, 2022
Nov 8, 2022
Nov 14, 2022
Dec 20, 2022
Jan 23, 2023
Dec 20, 2022
Nov 14, 2022
Nov 14, 2022

Repository files navigation

πŸ‘¨β€πŸ”¬ vew-api

An experimental API for the Value-Enabled Web (VEW).

How to Run

You need a somewhat recent version of Node.js to run this.

  • npm install; then

  • npm run dev to run with hot reloading; or

  • npm start to run without hot reloading

The APIs will be served on port 3000.

API

GET /upcycle?url=<url>

Fetches and parses an article into readable VEW format.

Returns

For a successful query, a JSON object like this:

{
  "id": "<...>", // normalized article url,
  "content": "<...>" // readable article markdown,
  "paymentInfo": {
    "type": "<...>", // e.g. "lnAddress"
    "value": "<...>"
  }
  "_data": { // non standardized data
    "title": "<...>", // article title
    "html": "<...>", // cleaned article html
  }
}

If an error occurs, a JSON object like this:

{
  "error": "<...>" // description of the error
}