-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpokaplayer.js
25 lines (24 loc) · 894 Bytes
/
pokaplayer.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
const pokaLog = require("./log"); // 可愛控制台輸出
// start PokaPlayer
const jsonfile = require('jsonfile')
let config
try {
config = jsonfile.readFileSync("./config.json")
} catch (e) {
pokaLog.logErr('CONFIG', `config.json 讀取失敗`)
}
if (config) {
const { pokaStart } = require('./index')
pokaStart()
} else {
const express = require("express");
const app = express(); // Node.js Web 架構
pokaLog.log('INSTALL', `The configuration file has not yet been created`)
pokaLog.log('INSTALL', `Fill out the configuration file according to config-simple.json from the repo`)
pokaLog.log('INSTALL', `config.json 設定教學: https://git.io/PokaConfigChinese`)
app.use(express.static("install"))
const server = require("http").createServer(app)
server.listen(3000, () => {
pokaLog.log('INFO', 'http://localhost:3000/')
});
}