Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with Node.js Scripts for Push/Pull Operations #1375

Closed
johackim opened this issue Apr 30, 2024 · 1 comment
Closed

Problems with Node.js Scripts for Push/Pull Operations #1375

johackim opened this issue Apr 30, 2024 · 1 comment

Comments

@johackim
Copy link

johackim commented Apr 30, 2024

Hello Gun community, thanks for this awesome project 🙂!

I have a question about Gun, I'm using Gun with Node.js and I want to push updates from one script and pull updates from another script.

Why I can't do that?

// pull.js
const Gun = require('gun');

const gun = Gun('https://myserver.com/gun');

gun.get('db').get('config').on((data) => console.log({ data }));
// push.js
const Gun = require('gun');

const gun = Gun('https://myserver.com/gun');

gun.get('db').get('config').put('New config');
node pull.js # Pull updates
node push.js # Push updates

Updates doesn't appear in node pull.js when I execute node push.js until I restart the script node pull.js.

I don't want to restart the script node pull.js every time I push updates.

How to do?

@johackim
Copy link
Author

johackim commented May 2, 2024

Thanks @amark for your answer on chat.gun.eco!

Here the solution:

const gun = Gun({ peers: ['https://myserver.com/gun'], axe: false });

You have to disable axe.

@johackim johackim closed this as completed May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant