1

am looking to use a forerunnerDB , as a standalone database and running an electron framework to create a desktop , am having problem implementing the bootstrapped process,

var ForerunnerDB = require('forerunnerdb');
var fdb = new ForerunnerDB();

am using angular as the frontend , and electron bootstrapping ,

angular.module('RDash')
.controller('MasterCtrl', ['$scope', '$cookieStore', MasterCtrl])
.controller('tableCtrl',['$scope', '$cookieStore', tableCtrl]);

var ForerunnerDB = require('forerunnerdb');
var fdb = new ForerunnerDB();

but i get require == undefined error , where do bootstrap the forerunner

1 Answers1

0

The require() call is part of Node.js used to include modules for use. If you are trying to instantiate ForerunnerDB on the client-side or in a browser you need to include the file ./dist/fdb-all.min.js instead (which is included in the ForerunnerDB download) as described in the documentation here: https://github.com/Irrelon/ForerunnerDB#use-forerunnerdb-in-browser

In the index.html of your AngularJS app, put this in the <head> section before your angular scripts but after jQuery and other third party libraries:

<script src="./forerunnerdb/dist/fdb-all.min.js" type="text/javascript"></script>

Make sure you change the path of the file to wherever you have put ForerunnerDB.

Disclaimer: I am the creator of ForerunnerDB

Rob Evans
  • 6,750
  • 4
  • 39
  • 56