Skip to content

Commit

Permalink
add: GraphQL API (with OAuth2 and Discord integration)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciborn committed Jul 20, 2020
1 parent 6bde6b3 commit c303704
Show file tree
Hide file tree
Showing 29 changed files with 2,004 additions and 79 deletions.
14 changes: 10 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
require("dotenv").config();
const { ShardingManager } = require("discord.js");
const api = require("./src/api/api");

const manager = new ShardingManager("./bot.js", { token: process.env.TOKEN, shardArgs: process.argv.slice(2, 4) });
require("dotenv").config();

manager.on("shardCreate", shard => console.log(`! Launched shard ${shard.id}`));
manager.spawn(Number(process.env.SHARDS), 1, 60000);
if (process.argv.includes("--api")) {
api();
} else {
const manager = new ShardingManager("./bot.js", { token: process.env.TOKEN, shardArgs: process.argv.slice(2, 4) });
api(manager);
manager.on("shardCreate", shard => console.log(`! Launched shard ${shard.id}`));
manager.spawn(Number(process.env.SHARDS), 1, 60000);
}
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ services:
restart: always
env_file:
- .env
ports:
- "3306:3306"

phpmyadmin:
depends_on:
- db
image: phpmyadmin/phpmyadmin
image: phpmyadmin/phpmyadmin:5.0.2
restart: always
env_file:
- .env
environment:
PMA_HOST: db
ports:
- "44400:80"
- "44491:80"

aldebaran:
depends_on:
Expand All @@ -32,6 +34,8 @@ services:
environment:
- WAIT_HOSTS=db:3306
- WAIT_SLEEP_INTERVAL=5
expose:
- "44400"

volumes:
db-data:
Loading

0 comments on commit c303704

Please sign in to comment.