Open DePasqualeOrg opened 2 years ago
is there any app using this lib? maybe can take a look, ill guide myself with the tests..
Found it: https://github.com/immers-space/guppe/blob/main/index.js :rocket:
is there any app using this lib? maybe can take a look, ill guide myself with the tests..
Just added links to two apps using this library: https://github.com/immers-space/activitypub-express#next-steps-and-examples
@wmurphyrd Thank you for the example apps. Is there a "basic" demonstration of use somewhere? For instance, by tracing through the code I've figured out (I think) that this is how one would follow a user:
...
await app.listen(80, () => {
console.log(`Listening on domain.com:80`)
apex.offlineMode = false
apex.startDelivery();
})
...
const myUser = await apex.store.getObject(`https://domain.com/u/me`, true);
await apex.store.saveObject(myUser);
const toBeFollowedUserId = `https://domain.com/u/you`;
const toBeFollowedUser = await apex.store.getObject(id);
const followActivity = await apex.buildActivity('Follow', myUser.id, toBeFollowedUserId, { object: toBeFollowedUser });
apex.addToOutbox(myUser, followActivity);
However the Mongo record doesn't have a value
entry, so it never actually delivers anything, and I'm stuck. This is likely me doing something wrong since there's no basic code example to follow.
It would be really helpful to have a super-simplistic:
Note: My issues seem to revolve around this library doesn't work out of the box. All the mongo calls use things like result.value
and result.ok
, which do not exist in the installed libraries. In them, result
is the JSON object returned, and it is null
otherwise.
It would be great to have some code examples for creating an actor, creating an activity, following an actor, and other common actions. Based on the info in the readme, I'm not sure how to use this library after starting up the server.