-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
33 lines (25 loc) · 841 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Include dependencies
const socketio = require('socket.io');
const express = require('express');
const path = require('path');
const ytlist = require('youtube-playlist');
const chalk = require('chalk');
const ejs = require('ejs');
const remotemedia = require('./src/rm/server');
// Classes
const logging = require('./src/rm/logging');
const indexRouter = require('./routes/index');
// Constants
const port = 3694;
logging.info("Starting remote-media...");
logging.info("Starting express...");
//create express object
var expApp = express();
expApp.set('view engine', 'ejs')
expApp.use(indexRouter);
require.main.require(path.join(__dirname, '/routes/static'))(expApp);
//use it to serve pages from the web folder
expApp.use(express.static('web'));
// expApp.use(indexRouter);
var web = expApp.listen(port);
remotemedia.start(web);