mirror of
https://github.com/frappe/books.git
synced 2024-11-10 15:50:56 +00:00
25 lines
694 B
JavaScript
25 lines
694 B
JavaScript
const common = require('frappejs/common');
|
|
const RESTClient = require('frappejs/backends/rest_client');
|
|
const frappe = require('frappejs');
|
|
frappe.ui = require('./ui');
|
|
const Desk = require('./desk');
|
|
|
|
module.exports = {
|
|
async start({server, columns = 2}) {
|
|
window.frappe = frappe;
|
|
frappe.init();
|
|
frappe.registerLibs(common);
|
|
frappe.registerModels(require('frappejs/models'));
|
|
frappe.registerModels(require('../models'));
|
|
|
|
frappe.fetch = window.fetch.bind();
|
|
frappe.db = await new RESTClient({server: server});
|
|
|
|
frappe.flags.cache_docs = true;
|
|
|
|
frappe.desk = new Desk(columns);
|
|
await frappe.login();
|
|
}
|
|
};
|
|
|