Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Don't mess these first few lines
const juice = require('juice');
var app = new juice.Application(module),
proto = app.prototype;
/*
Example model:
var DB = proto.models.DB = function( app ) {
this.db = new require('sqlite3').SQLite3( app.config.dbname );
}
DB.prototype.all = function() {
return this.db.query("SELECT * FROM table");
}
Then use it in a controller like:
proto.controllers.list = function ( ) {
return { rows: this.models.DB.all() }
}