Skip to content

Latest commit

 

History

History
64 lines (49 loc) · 1.23 KB

File metadata and controls

64 lines (49 loc) · 1.23 KB

SPOO (Build a Platform)

SPOO

SPOO is a framework for exposing any OBJY environment via REST. It comes with everythyng needed for running a platform.

For running a basic platform you will need Node.js, Redis and MongoDB. This will change in the future. The following quick examples show you how to spin up a platform and a client with just a few lines of code.

Server

npm i objy spoojs
const OBJY = require('objy');
const SPOO = require('spoojs');

OBJY.define({
  name: "user",
  pluralName: "users",
  authable: true
})

OBJY.define({
  name: "object",
  pluralName: "objects"
})

SPOO.REST({
  OBJY,
}).run()

Client

Connect to a SPOO instance

<script src="https://cdn.jsdelivr.net/npm/objy-connect/index.js">

or

npm i objy-connect
let remote = new CONNECT(OBJY)

OBJY.define({
  name: "object",
  pluralName: "objects",
  storage: remote
})

// Login
remote.connect({client: "myclient", url: "https://mydomain.com/api", username: "user", password: "***"}, () => {
  OBJY.objects({}).get(data => {
    console.log('data:', data)
  }, err => {
    console.log('err:', err)
  })
})