spoo-connect

0.0.48 • Public • Published

SPOO Connect

The mapper can be used as OBJY storage for interacting with any SPOO-based platform. Just define your object wrappers and use the connect mapper for storage.

Documentation

Find the full documentation at objy.xyz.

Usage

You need OBJY and this mapper.

Browser

<script src="https://cdn.jsdelivr.net/npm/objy/dist/browser.js" />
<script src="https://cdn.jsdelivr.net/npm/objy-connect/index.js" />
<script>
let remote = new CONNECT(OBJY);
remote.connect({client: "myclient", url: "https://mydomain.com/api"})

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

// Login
remote.login({username: "user", password: "***"}, () => {
	OBJY.objects({}).get(data => {
		console.log('data:', data)
	}, err => {
		console.log('err:', err)
	})
})
</script>

Node

npm i objy objy-connect --save
let OBJY = require('objy');
let CONNECT = require('objy-connect');

let remote = new CONNECT(OBJY);
remote.connect({client: "myclient", url: "https://mydomain.com/api"});

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

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

Readme

Keywords

none

Package Sidebar

Install

npm i spoo-connect

Weekly Downloads

2

Version

0.0.48

License

ISC

Unpacked Size

9.12 kB

Total Files

4

Last publish

Collaborators

  • marcoboelling