-
Notifications
You must be signed in to change notification settings - Fork 5
/
dev.js
44 lines (35 loc) · 1.08 KB
/
dev.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
34
35
36
37
38
39
40
41
42
43
44
/**
* @file DTPS development server
* @author jottocraft
*
* @copyright Copyright (c) 2018-2023 jottocraft
* @license MIT
*/
const express = require('express');
const app = express();
var port = 2750;
//Check CLI args
process.argv.forEach(arg => {
if (arg.startsWith("--port=")) {
port = Number(arg.replace("--port=", ""));
}
})
//Serve dev
app.get('/dtps/dev', function(req, res) {
res.send(true);
});
//Serve scripts
app.use('/scripts', express.static('scripts'));
//Serve root-level script
app.use('/init.js', express.static('init.js'));
//Serve UI files
app.use('/dtps.css', express.static('ui/dtps.css'));
app.use('/fluid/fluid.css', express.static('ui/fluid.css'));
app.use('/fluid/fluid.js', express.static('ui/fluid.js'));
//Serve www
app.use('/', express.static('www'));
app.listen(port, () => {
console.log("The Power+ development server is listening on port " + port);
console.log("\nGo to Settings -> About -> Advanced Options -> Enable debug config in Power+ to enable debug mode");
console.log("Read CONTRIBUTING.md for more information");
});