Skip to content

Custom Databases

Save, get and delete variables from the database, using the DatabaseManager.

Setting a custom database

/index.js
var { API } = require("easy-api.ts");
var { QuickDB } = require("quick.db");
var api = new API(...);
var db = new QuickDB();
api.db.setDatabase(db);
// api.db is the DatabaseManager.
// api.db.driver is the database itself.
// Connecting the database manually.
api.db.start(/* Method to connect your database without being called. (ex. <CustomDB>.connect) */);
api.connect({ port: 5000 });

Connecting the database

/index.js
var { API } = require("easy-api.ts");
var api = new API(...);
// Connecting the default database.
api.db.start(api.db.driver.start);
api.connect({ port: 5000 });