README
Aries Framework JavaScript REST API
Aries Framework JavaScript REST API is a wrapper around Aries Framework JavaScript.
Installation
Make sure you have set up the correct version of Aries Framework JavaScript according to the AFJ repository. To find out which version of AFJ you need to have installed you can run the following command. This will list the required peer dependency for @aries-framework/core
.
npm info "@aries-framework/rest" peerDependencies
Then add the rest package to your project.
yarn add @aries-framework/rest
Quick start
The OpenAPI spec is generated using the OpenAPI Schema (Swagger). However this schema is not representing the real API. A lot of types are not correct. Keep this in mind when using this package.
Aries Framework JavaScript REST API provides a Swagger (OpenAPI) definition of the exposed API. After you start the REST API the generated API Client will be available on /docs
.
Example of usage
import { startServer } from '@aries-framework/rest'
// The startServer function requires an initialized agent and a port.
// An example of how to setup an agent is located in the `samples` directory.
const run = async (agent: Agent) => {
await startServer(agent, { port: 3000 })
}
// A Swagger (OpenAPI) definition is exposed on http://localhost:3000/docs
run()