Settings Guide

MeeseOS provides options for customizing the settings storage.

Two adapters are provided by default:

  • localStorage (in-browser, default)
  • server (via server)

Configuring adapter

See official resource list for provided adapter.

The README file of the module should provide more specific examples.

See provider guide for more information about provider setup.

Client

meeseOS.register(SettingsServiceProvider, {
  args: {
    adapter: "server"
  }
});

Server

const customAdapter = require("custom-adapter");

meeseOS.register(SettingsServiceProvider, {
  args: {
    adapter: customAdapter
  }
});

Storing on filesystem

You can use the provided fs adapter to store settings on a filesystem:

Settings are stored in home:/.meeseOS/settings.json by default.

// client
meeseOS.register(SettingsServiceProvider, {
  args: {
    adapter: "server"
  }
});

// server
meeseOS.register(SettingsServiceProvider, {
  args: {
    adapter: "fs",
  }
});

Configure adapter settings

The config parameter is passed on from your service provider registration:

meeseOS.register(SettingsServiceProvider, {
  args: {
    adapter: customAdapter
    config: { /* Your configuration here */}
  }
});

If you have sensitive information in your configuration, consider using complex-dotenv-json.

MeeseOS Web Desktop - © Aaron Meese <aaronjmeese@gmail.com>

results matching ""

    No results matching ""