mirror of
https://github.com/IrosTheBeggar/mStream.git
synced 2025-10-27 07:31:02 +00:00
new webb app config flags
This commit is contained in:
parent
601cb033d3
commit
07a308afb7
@ -43,6 +43,9 @@ exports.setup = function (args) {
|
||||
// JSON config
|
||||
.option('-j, --json <json>', 'Specify JSON Boot File')
|
||||
|
||||
// New Web App
|
||||
.option('-q, --newapp', 'Try the new web app')
|
||||
|
||||
// Wizard
|
||||
.option("-w, --wizard [file]", "Setup Wizard")
|
||||
.parse(args);
|
||||
@ -108,6 +111,7 @@ exports.setup = function (args) {
|
||||
}
|
||||
}
|
||||
|
||||
if (program.newapp) { program3.newWebApp = true }
|
||||
if (program.userinterface) { program3.webAppDirectory = program.userinterface }
|
||||
if (program.secret) { program3.secret = program.secret; }
|
||||
if (program.skipimg) { program3.scanOptions.skipImg = true; }
|
||||
|
||||
@ -25,6 +25,7 @@ exports.setup = function (config) {
|
||||
address: Joi.string().ip({ cidr: 'forbidden' }).default('127.0.0.1'),
|
||||
port: Joi.number().default(3000),
|
||||
noLogin: Joi.boolean().default(false),
|
||||
newWebApp: Joi.boolean().default(false),
|
||||
supportedAudioFiles: Joi.object().pattern(
|
||||
Joi.string(),
|
||||
Joi.boolean()
|
||||
|
||||
46
mstream.js
46
mstream.js
@ -48,27 +48,31 @@ exports.serveIt = config => {
|
||||
next();
|
||||
});
|
||||
|
||||
// Give access to public folder
|
||||
mstream.use('/public', express.static( program.webAppDirectory ));
|
||||
// Serve the webapp
|
||||
mstream.get('/', (req, res) => {
|
||||
res.sendFile('mstream.html', { root: program.webAppDirectory });
|
||||
});
|
||||
mstream.get('/j/*', (req, res) => {
|
||||
res.sendFile( 'mstream.html', { root: program.webAppDirectory });
|
||||
});
|
||||
// It Really Whips The Llama's Ass
|
||||
mstream.get('/winamp', (req, res) => {
|
||||
res.sendFile('winamp.html', { root: program.webAppDirectory });
|
||||
});
|
||||
// Serve Shared Page
|
||||
mstream.all('/shared/playlist/*', (req, res) => {
|
||||
res.sendFile( 'shared.html', { root: program.webAppDirectory });
|
||||
});
|
||||
// Serve Jukebox Page
|
||||
mstream.all('/remote', (req, res) => {
|
||||
res.sendFile('remote.html', { root: program.webAppDirectory });
|
||||
});
|
||||
if (program.newWebApp) {
|
||||
mstream.use(express.static( 'webapp-beta' ));
|
||||
} else {
|
||||
// Give access to public folder
|
||||
mstream.use('/public', express.static( program.webAppDirectory ));
|
||||
// Serve the webapp
|
||||
mstream.get('/', (req, res) => {
|
||||
res.sendFile('mstream.html', { root: program.webAppDirectory });
|
||||
});
|
||||
mstream.get('/j/*', (req, res) => {
|
||||
res.sendFile( 'mstream.html', { root: program.webAppDirectory });
|
||||
});
|
||||
// It Really Whips The Llama's Ass
|
||||
mstream.get('/winamp', (req, res) => {
|
||||
res.sendFile('winamp.html', { root: program.webAppDirectory });
|
||||
});
|
||||
// Serve Shared Page
|
||||
mstream.all('/shared/playlist/*', (req, res) => {
|
||||
res.sendFile( 'shared.html', { root: program.webAppDirectory });
|
||||
});
|
||||
// Serve Jukebox Page
|
||||
mstream.all('/remote', (req, res) => {
|
||||
res.sendFile('remote.html', { root: program.webAppDirectory });
|
||||
});
|
||||
}
|
||||
|
||||
// JukeBox
|
||||
jukebox.setup2(mstream, server, program);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user