Generates on load now :)
This commit is contained in:
parent
a493263f72
commit
2e20608cc1
1 changed files with 8 additions and 8 deletions
16
index.js
16
index.js
|
@ -44,6 +44,10 @@ app.listen(PORT, () => {
|
||||||
console.log("Violet's Purgatory is now listening on port: " + PORT)
|
console.log("Violet's Purgatory is now listening on port: " + PORT)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.get('/', (req, res) => {
|
||||||
|
res.send(pageUpdate())
|
||||||
|
})
|
||||||
|
|
||||||
function pageUpdate() {
|
function pageUpdate() {
|
||||||
var statuses = {
|
var statuses = {
|
||||||
"online": {
|
"online": {
|
||||||
|
@ -261,12 +265,10 @@ function pageUpdate() {
|
||||||
html = '<!-- The following code is dynamically generated, I apologize for any formatting errors. Please view the "resources/mainPage.html" on the codeberg repository for something more readable. -->\n' + html
|
html = '<!-- The following code is dynamically generated, I apologize for any formatting errors. Please view the "resources/mainPage.html" on the codeberg repository for something more readable. -->\n' + html
|
||||||
|
|
||||||
html = html.replace("{THUMBOR}", getThumbor())
|
html = html.replace("{THUMBOR}", getThumbor())
|
||||||
// fetch('https://github.com/Violets-puragtory/Violets-Purgatory.dev')
|
|
||||||
// .then(((data) => data.text()))
|
// fs.writeFileSync(path.join(__dirname, 'static/index.html'), html)
|
||||||
// .then((text) => {
|
|
||||||
// console.log(text)
|
return html
|
||||||
// })
|
|
||||||
fs.writeFileSync(path.join(__dirname, 'static/index.html'), html)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lanyard Stuffs
|
// Lanyard Stuffs
|
||||||
|
@ -298,8 +300,6 @@ lanyard.addEventListener("message", (res) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
pageUpdate()
|
|
||||||
|
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
res.status(404).send(`
|
res.status(404).send(`
|
||||||
<link rel="stylesheet" href="/style.css">
|
<link rel="stylesheet" href="/style.css">
|
||||||
|
|
Loading…
Reference in a new issue