PeakDB
  • Introduction
  • Quick Start
  • Change Log
  • Reference
    • Bitwise Permission Flags
    • Supported Node.js Versions
    • NPM
    • GitHub
  • Constructors
    • Server
    • Connection
    • Collection
  • Classes
    • Collection
      • createBackup
      • loadBackup
      • drop
    • DocumentBasedCollection
      • insert
      • find
      • filter
      • has
      • update
      • archive
      • unarchive
      • delete
    • KeyValueBasedCollection
      • set
      • get
      • push
      • remove
      • find
      • filter
      • has
      • increase
      • decrease
      • delete
Powered by GitBook
On this page
  1. Constructors

Server

Create a server and allow remote connection.

new Server(options)

Create a server to be able to connect remotely.

Parameter
Default
Description

options

options.port

4951

options.users

options.users[].username

options.users[].password

options.users[].permissions

Example:

const example_server = new <PeakDB>.Server({
  "port": 4951,
  "users": [
    {
      "username": "fir4tozden",
      "password": "ZdJuTNqUXpqNrw2H",
      "permissions": 1 << 0 | 1 << 3 // read and delete
    },
    {
      "username": "nehir",
      "password": "yPIkXo3l82aMbJZc",
      "permissions": 1 << 0 | 1 << 1 | 1 << 2 // read, write and update
    }
  ]
});
PreviousReferenceNextConnection

Last updated 3 years ago

Server options.

(optional) Port of server.

<> List of users to connect to the server.

Name of the user to connect to the server.

Password of the user to connect to the server.

User's permission flags on collections.

Object
Number
Array
Object
String
String
Number