[MAJOR][FIRSTCOMMIT] Added basic routes, controllers, repos to kanban service (no postgres yet)
This commit is contained in:
27
lib/repos/MockOrm.js
Normal file
27
lib/repos/MockOrm.js
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const jsonfile_1 = __importDefault(require("jsonfile"));
|
||||
// **** Variables **** //
|
||||
const DB_FILE_NAME = 'database.json';
|
||||
// **** Functions **** //
|
||||
/**
|
||||
* Fetch the json from the file.
|
||||
*/
|
||||
function openDb() {
|
||||
return jsonfile_1.default.readFile(__dirname + '/' + DB_FILE_NAME);
|
||||
}
|
||||
/**
|
||||
* Update the file.
|
||||
*/
|
||||
function saveDb(db) {
|
||||
return jsonfile_1.default.writeFile((__dirname + '/' + DB_FILE_NAME), db);
|
||||
}
|
||||
// **** Export default **** //
|
||||
exports.default = {
|
||||
openDb,
|
||||
saveDb,
|
||||
};
|
||||
//# sourceMappingURL=MockOrm.js.map
|
||||
Reference in New Issue
Block a user