summaryrefslogtreecommitdiff
path: root/src/ws/ws.ts
diff options
context:
space:
mode:
author8cy <[email protected]>2020-05-05 15:17:58 -0700
committer8cy <[email protected]>2020-05-05 15:17:58 -0700
commit7a26c1a3727b7072835680687ebb38473e1a09cc (patch)
tree1faf5a6cb771737570c04fc813fd5f266c95fe7c /src/ws/ws.ts
parentadd genservers (diff)
downloaddep-core-7a26c1a3727b7072835680687ebb38473e1a09cc.tar.xz
dep-core-7a26c1a3727b7072835680687ebb38473e1a09cc.zip
add build scripts, remove dist
- remove some db errors, namely ones that are bs like no on doc type errors - move ws to spike - remove copy npm scripts i think - remove .env and package
Diffstat (limited to 'src/ws/ws.ts')
-rw-r--r--src/ws/ws.ts54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/ws/ws.ts b/src/ws/ws.ts
deleted file mode 100644
index 08f9581..0000000
--- a/src/ws/ws.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import express from 'express';
-import hbs from 'express-handlebars';
-import bodyParser from 'body-parser';
-import path from 'path';
-
-class WebSocket {
- constructor(token, port, client) {
- this.token = token;
- this.client = client;
-
- this.app = express()
- this.app.engine('hbs', hbs({
- extname: 'hbs',
- defaultLayout: 'layout',
- layoutsDir: __dirname + '/layouts'
- }))
- this.app.set('views', path.join(__dirname, 'views'))
- this.app.set('view engine', 'hbs')
- this.app.use(express.static(path.join(__dirname, 'public')))
- this.app.use(bodyParser.urlencoded({ extended: false }))
- this.app.use(bodyParser.json())
-
- this.registerRoots()
-
- this.server = this.app.listen(port, () => {
- console.log(`Websocket listening on port ${this.server.address().port}`)
- })
- }
-
- checkToken(_token) {
- return (_token == this.token)
- }
-
- // http://localhost:port?token=123456
- registerRoots() {
- this.app.get('/', (req, res) => {
- var _token = req.query.token
- // if (!this.checkToken(_token)) {
- // res.render('error', {
- // title: 's1nical - Error',
- // errtype: 'INVALID TOKEN'
- // })
- // return
- // }
-
- res.render('index', {
- title: 'Uwufier - Status',
- token: _token
- })
- })
- }
-}
-
-module.exports = WebSocket \ No newline at end of file