Skip to content

Pardalotus/metabeak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pardalotus Metabeak

The code that powers the Pardalotus API.

Work in progress, pre-release.

Development

Drop and create DB:

(cd etc; ./reset_db.sh)

Load sample events and handlers:

export DB_URI=postgres://metabeak:metabeak@localhost/metabeak

cargo run -- --load-events samples/events --load-handlers samples/handlers --execute-one

Fetch some metadata assertions from Crossref:

cargo run -- --fetch-crossref

Extract events from metadata assertions:

cargo run -- --extract

Run handler functions for events

cargo run -- --execute

Run API

cargo run -- --api

These flags can all be combined, except --execute, which are --api are blocking and mutually exclusive.

API

To upload a function:

$ curl -F data=@./samples/handlers/hello.js localhost:6464/functions
{
  "status": "created",
  "data": {
    "id": 44,
    "code": "var f = function (arg) {\n  return [\"Hello\", \"World??\", arg];\n};\n",
    "status": "Enabled"
  }
}

When a cursor value is returned, pass it with ?cursor= to get the next page. These cursors do not timeout, although the data may.

License

Copyright 2024 Joe Wass, Pardalotus Technology. This code is Apache 2 licensed, see the LICENSE.txt and NOTICE files.

About

Scholarly Metadata Events API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published