lorant_api
v1.7.10
Published
Lorant CMS and Email API for NodeJS
Downloads
5
Readme
LorantMMS NodeJS API
DB Usage
var sqldb = require('lorant_api').sqldb;
var config = {
database: 'database name',
username: 'username',
password: 'password',
options: { /* options object */ }
};
sqldb.init(config)
.then(function (db) {
// db will contain all the models from the DB
});
// After initialization
sqldb.queryData(/* query string */)
.then(function (data) {
// will contain all the DB data
});
sqldb.update(type, props);
sqldb.updateFileName(type, id, file);
sqldb.queryCMS(supercat, cat, subcat, subsubcat, thirdcat)
.then(function (data) {
// will contain the required data or the list of supercategories
});
Email Usage
var mail = require('lorant_api').email;
// Not needed unless you need to override defaults
mail.config({
user, // Mail User
password, // Mail Password
host, // Mail Host
site, // Site name
port, // Port
email, // Sender email
to, // Receiver email
subject // Email Subject
});
// Can be called instantly after requiring
// No need to setup with config if defaults wanted
mail.send({
name, // Sender name
email, // Sender email
message, // Sender message
});