Skip to content

Add documentation to execute the simple sync demo #3

Open
@woutslabbinck

Description

@woutslabbinck

Start with the following

Install project

npm i https://github.com/woutslabbinck/Solid-Agent --save-dev

Solid Sync Demo

# set up a Solid server
npx @solid/community-server -c @css:config/file-no-setup.json -f ./data
# create a state resource
curl -X PUT -d "". http://localhost:3000/state -H "content-type: text/turtle"

execute following code

const {DemoSyncAgent, SubscriptionEnum} = require("solid-agent")

async function main(){
    const demo = new DemoSyncAgent({
        solid: {
            solidResources: ['http://localhost:3000/state'],
            subscriptionType: {type: SubscriptionEnum.PUSH}
        }
    })
    await demo.start()
}

Execute a curl request to change the state resource

curl -X PUT -d "<a> <b> <c>". http://localhost:3000/state -H "content-type: text/turtle"

You will see that two resources wil be created http://localhost:3000/random and http://localhost:3000/test, which both contain the exact same content as http://localhost:3000/state which you just updated.

That is due the simple demo agent executing following rules, which will execute the fnoUpdateSolidState plugin.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions