Papupata Documentation

API Reference

class DeclaredAPI

property implementation

Purpose

Contains the latest implementation for the API. This exists primarily to help with testing the API implementations by providing direct access to them.

Examples

import { APIDeclaration } from 'papupata'
const api = new APIDeclaration()
const myAPI = api.declareGetAPI('/get-stuff')
  .response<string>()

const implFn = () => Promise.resolve('test')
myAPI.implement(implFn)

// myAPI.implementation === implFn