include plugins from shout config directory in html
This commit is contained in:
parent
af563db0e2
commit
05c910c9d3
|
@ -287,5 +287,9 @@
|
|||
<script src="js/shout.templates.js"></script>
|
||||
<script src="js/shout.js"></script>
|
||||
|
||||
<% plugins.forEach(function(file) { %>
|
||||
<script src="plugins/<%= file %>"></script>
|
||||
<% }) %>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -13,12 +13,28 @@ var manager = new ClientManager();
|
|||
|
||||
module.exports = function(options) {
|
||||
config = Helper.getConfig();
|
||||
config = _.extend(config, options);
|
||||
config = _.extend(config, options, {
|
||||
plugins: []
|
||||
});
|
||||
|
||||
var app = express()
|
||||
.use(index)
|
||||
.use(express.static("client"));
|
||||
|
||||
fs.readdir(Helper.HOME + '/plugins', function(err, files) {
|
||||
if (err) {
|
||||
if (err.code !== 'ENOENT') {
|
||||
console.log(err);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (files.length) {
|
||||
config.plugins = files;
|
||||
app.use('/plugins', express.static(Helper.HOME + '/plugins'));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
app.enable("trust proxy");
|
||||
|
||||
var server = null;
|
||||
|
|
Loading…
Reference in New Issue