mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -04:00
nvm i do need express
This commit is contained in:
parent
ce726191bc
commit
46c93b0c4e
2 changed files with 12 additions and 3 deletions
12
index.js
12
index.js
|
@ -1,12 +1,12 @@
|
|||
const { ClusterManager } = require('detritus-client');
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const time = Date.now();
|
||||
|
||||
const token = process.env.token;
|
||||
|
||||
let client = `../${__dirname}/labscore/client.js`
|
||||
|
||||
if(process.env.environment == "local") client = `./labscore/client.js`
|
||||
|
||||
const manager = new ClusterManager(client, token, {
|
||||
shardCount: 2,
|
||||
shardsPerCluster: 1,
|
||||
|
@ -17,3 +17,11 @@ const manager = new ClusterManager(client, token, {
|
|||
await manager.run();
|
||||
console.log(`v2 | ready. took ${(Date.now() - time) / 1000}.`)
|
||||
})();
|
||||
|
||||
app.get("*", function (request, response) {
|
||||
response.send(`🧪 v2 @ ${Date.now()}`);
|
||||
});
|
||||
|
||||
var listener = app.listen(process.env.PORT, function () {
|
||||
console.log(`v2 | web server live on port ${listener.address().port}.`);
|
||||
});
|
|
@ -14,6 +14,7 @@
|
|||
"detritus-client": "^0.17.0-beta.12",
|
||||
"dotenv": "^16.0.1",
|
||||
"emoji-aware": "^3.1.0",
|
||||
"express": "^4.18.1",
|
||||
"superagent": "^7.1.1"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue