Compare commits
2 commits
4e01a2497c
...
3925327875
Author | SHA1 | Date | |
---|---|---|---|
3925327875 | |||
ae576d6ca9 |
4 changed files with 35 additions and 26 deletions
28
expressHandler.js
Normal file
28
expressHandler.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
const express = require("express"),
|
||||
path = require("path")
|
||||
|
||||
var app = express()
|
||||
|
||||
const PORT = process.env.PORT || 8080
|
||||
|
||||
const cachePath = path.join(__dirname, 'cached')
|
||||
const assetPath = path.join(__dirname, "assets")
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log("Violet's Purgatory is now listening on port: " + PORT)
|
||||
})
|
||||
|
||||
const pageUpdater = require("./pageUpdater.js")
|
||||
|
||||
app.use("/fonts", express.static(path.join(assetPath, "fonts")))
|
||||
app.use("/cached", express.static(cachePath))
|
||||
app.use("/imgs", express.static(path.join(assetPath, "Images")))
|
||||
app.use("/snds", express.static(path.join(assetPath, "Sounds")))
|
||||
|
||||
app.use("/emojis", express.static(path.join(cachePath, "emojis")))
|
||||
|
||||
app.use(pageUpdater.middleWare)
|
||||
|
||||
module.exports = {
|
||||
app: app
|
||||
}
|
21
index.js
21
index.js
|
@ -1,12 +1,8 @@
|
|||
const express = require('express'),
|
||||
const express = require('./expressHandler.js'),
|
||||
path = require('path'),
|
||||
fs = require('fs'),
|
||||
WebSocket = require("ws")
|
||||
|
||||
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")
|
||||
|
@ -27,21 +23,8 @@ if (!fs.existsSync(announcementFile)) {
|
|||
fs.writeFileSync(announcementFile, ``)
|
||||
}
|
||||
|
||||
const pageUpdater = require('./pageUpdater.js')
|
||||
|
||||
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)
|
||||
})
|
||||
|
||||
app.use("/fonts", express.static(path.join(assetPath, "fonts")))
|
||||
app.use("/cached", express.static(cachePath))
|
||||
app.use("/imgs", express.static(path.join(assetPath, "Images")))
|
||||
app.use("/snds", express.static(path.join(assetPath, "Sounds")))
|
||||
|
||||
app.use("/emojis", express.static(path.join(cachePath, "emojis")))
|
||||
|
||||
if (!fs.existsSync(cachePath)) {
|
||||
fs.mkdirSync(cachePath)
|
||||
}
|
||||
|
@ -50,8 +33,6 @@ if (!fs.existsSync(path.join(cachePath, "emojis"))) {
|
|||
fs.mkdirSync(path.join(cachePath, "emojis"))
|
||||
}
|
||||
|
||||
app.use(pageUpdater.middleWare)
|
||||
|
||||
process.on('uncaughtException', (err, origin) => {
|
||||
fs.writeSync(
|
||||
process.stderr.fd,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
#card {
|
||||
background-color: rgba(20, 5, 90, 0.5);
|
||||
background-color: rgba(25, 0, 70, 1);
|
||||
/* backdrop-filter: blur(5px); */
|
||||
}
|
||||
.magicStuff {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
#card {
|
||||
background-color: rgba(50, 0, 90, 0.5);
|
||||
background-color: rgba(25, 0, 70, 1);
|
||||
/* backdrop-filter: blur(5px); */
|
||||
}
|
||||
.rainStuff {
|
||||
|
|
Loading…
Reference in a new issue