Change old config to constants, add real conffig file, add daily video URLs.

This commit is contained in:
bingus_violet 2024-05-20 10:20:19 -05:00
parent 710d7c237f
commit 8e703ecd3f
8 changed files with 46 additions and 18 deletions

View file

@ -9,16 +9,26 @@ var app = express()
const PORT = process.env.PORT || 8080
const staticpath = path.join(__dirname, 'static')
const cachePath = path.join(__dirname, 'cached')
const assetPath = path.join(__dirname, "assets")
const configPath = path.join(__dirname, 'config')
var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json')))
const configFile = path.join(configPath, "config.json")
if (!fs.existsSync(configPath)) {
fs.mkdirSync(configPath)
}
if (!fs.existsSync(configFile)) {
fs.writeFileSync(configFile, fs.readFileSync(path.join(assetPath, "defaults/config.json")))
}
var constants = JSON.parse(fs.readFileSync(path.join(__dirname, 'constants.json')))
app.listen(PORT, () => {
console.log("Violet's Purgatory is now listening on port: " + PORT)
})
var cachePath = path.join(__dirname, 'cached')
var assetPath = path.join(__dirname, "assets")
app.use("/fonts", express.static(path.join(assetPath, "fonts")))
app.use("/cached", express.static(cachePath))
app.use("/imgs", express.static(path.join(assetPath, "Images")))