1.1.1 • Published 3 years ago

@anyapi/anyapi v1.1.1

Weekly downloads
202
License
MIT
Repository
github
Last release
3 years ago

GitHub Workflow Status codecov

Getting Started

npx @anyapi/anyapi

or

npm i @anyapi/anyapi -g
anyapi

This will start the server on the default port of 2000. Using any HTTP client you can now GET, POST, PUT, DELETE with a collection type that is completely variable and up to you.

For example hamburgers:

fetch('http://localhost:2000/hamburgers', {
  method: 'POST',
  body: JSON.stringify({ name: 'Cheese Burger', ingredients: ['beef', 'tomato', 'lettuce', 'cheese'] }),
  headers: new Headers({'Content-Type': 'application/json'})
})

Then GET on http://localhost:2000/hamburgers to see your new collection

Methods

  • GETALL on :collection
  • GET on :collection with :id
  • CREATE on :collection with :data
  • UPDATE on :collection with :id and :data
  • DESTROY on :collection with :id