Skip to content
Hector edited this page Aug 24, 2021 · 6 revisions

lib/hub.js (server-side only)

Host your website on Gun !

The hub feature is an optional feature that allows you to watch a directory and upload all of its content on the database (only text files are supported for now).

How to use it ?

First, you must install Chokidar. When it’s done, import hub.js :

const hub = require('gun/lib/hub'); // Classic 
// or
import hub from ‘gun/lib/hub’; // ES6’s way
// then
hub.watch(/* The path you want to watch. */)

Options

what (String) - Which directory hub should watch.
options (Object) - Change the behavior of hub.

// Available options
{
   msg: true // or false | disable or enable update messages
}

This wiki is where all the GUN website documentation comes from.

You can read it here or on the website, but the website has some special features like rendering some markdown extensions to create interactive coding tutorials.

Please feel free to improve the docs itself, we need contributions!

Clone this wiki locally