diff options
| author | 8cy <[email protected]> | 2020-07-23 23:24:17 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-07-23 23:24:17 -0700 |
| commit | bb511abc03bb66848947e37a999502b813c77269 (patch) | |
| tree | 612c010fc8317e1cdf11471a18aad0270819d33e /src/server.ts | |
| parent | fix: if clear amount equal or over 100, round down to 99 (diff) | |
| download | dep-core-bb511abc03bb66848947e37a999502b813c77269.tar.xz dep-core-bb511abc03bb66848947e37a999502b813c77269.zip | |
goodbye old uwufier :cry:
Diffstat (limited to 'src/server.ts')
| -rw-r--r-- | src/server.ts | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/server.ts b/src/server.ts deleted file mode 100644 index 11576f1..0000000 --- a/src/server.ts +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-nocheck //TODO: this - -import express from 'express'; -import bodyParser from 'body-parser'; - -class WebSocket { - client: any; - app: any; - server: any; - constructor(port: any, client: any) { - this.client = client; - - this.app = express() - this.app.use(bodyParser.urlencoded({ extended: false })) - this.app.use(bodyParser.json()) - - this.registerRoots() - - this.server = this.app.listen(port, () => { - console.log('\x1b[0m' + 'Listening on port: ' + '\x1b[36m' + this.server.address().port) - }) - } - // http://localhost:port?token=123456 - registerRoots() { - this.app.all('*', function (req, res, next) { - res.header('Access-Control-Allow-Origin', '*'); - res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS'); - res.header('Access-Control-Allow-Headers', 'Content-Type'); - next(); - }); - - this.app.get('/', (req, res) => { - res.redirect('https://kyzer.co/discord/bots/uwufier/') - }) - this.app.get('/api/v1/commands/', async (req, res) => { - res.json({ commands: await this.client.registry.commands.size }) - }); - this.app.get('/api/v1/groups/', async (req, res) => { - res.json({ groups: await this.client.registry.groups.size }) - }); - this.app.get('/api/v1/commands/groups/', async (req, res) => { - res.json({ groups: await this.client.registry.groups.size }) - }); - this.app.get('/api/v1/guilds/', async (req, res) => { - res.json({ guilds: await this.client.guilds.cache.size }) - }); - } -} - -module.exports = WebSocket
\ No newline at end of file |