This commit is contained in:
Violet 2023-09-21 21:18:23 +00:00 committed by GitHub
commit 8b82bde024
10 changed files with 1043 additions and 0 deletions

41
index.js Normal file
View file

@ -0,0 +1,41 @@
const express = require('express'),
// ws = require('ws'),
path = require('path'),
fs = require('fs')
// const websocket = new ws.WebSocket('wss://api.lanyard.rest/socket', {})
// var heartInt = 30000
// function heartbeat() {
// websocket.send(JSON.stringify({op: 3}))
// setTimeout(() => {
// heartbeat()
// }, heartInt);
// }
// websocket.on('message', function mess(buffer, bing) {
// var data = JSON.parse(buffer)
// var opc = data.op
// console.log(data)
// if (opc == 1) {
// heartint = buffer.heartbeat_interval
// heartbeat()
// }
// })
var app = express()
const PORT = process.env.PORT || 8080
const staticpath = path.join(__dirname, (process.env.STATIC_PATH || 'static/'))
app.use(express.static(staticpath))
app.listen(PORT, () => {
console.log("Violets-Purgatory is now listening on port: " + PORT)
})