mirror of
https://github.com/janishutz/libreevent.git
synced 2026-09-22 13:15:25 +02:00
23 lines
869 B
JavaScript
23 lines
869 B
JavaScript
/*
|
|
* libreevent - pluginLoader.js
|
|
*
|
|
* Created by Janis Hutz 08/13/2023, Licensed under the GPL V3 License
|
|
* https://janishutz.com, development@janishutz.com
|
|
*
|
|
*
|
|
*/
|
|
|
|
const fs = require( 'fs' );
|
|
const path = require( 'path' );
|
|
|
|
module.exports = ( app, settings ) => {
|
|
console.log( '\n\n[ Plugin Loader ] Loading plugins\n' );
|
|
let otherPlugins = fs.readdirSync( path.join( __dirname + '/others' ) );
|
|
for ( let plugin in otherPlugins ) {
|
|
require( './others/' + otherPlugins[ plugin ] + '/' + otherPlugins[ plugin ] + 'Routes.js' )( app, settings );
|
|
console.log( '[ Plugin Loader ] Loaded plugin "' + otherPlugins[ plugin ] + '"' );
|
|
}
|
|
|
|
require( './payments/' + settings.payments + '/' + settings.payments + 'Routes.js' )( app, settings );
|
|
console.log( '[ Plugin Loader ] Loaded ' + settings.payments + ' as payment gateway' );
|
|
}; |