mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-18 07:35:02 +00:00
Dashboard work. Move configs to DB. Some script reorganization. Add nodemon configs.
This commit is contained in:
parent
38c65b9618
commit
323c7e66aa
39 changed files with 8441 additions and 2915 deletions
15
src/api/guilds.ts
Normal file
15
src/api/guilds.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import express from "express";
|
||||
import passport from "passport";
|
||||
import { AllowedGuilds } from "../data/AllowedGuilds";
|
||||
|
||||
export function initGuildsAPI(app: express.Express) {
|
||||
const guildAPIRouter = express.Router();
|
||||
guildAPIRouter.use(passport.authenticate("api-token"));
|
||||
|
||||
const allowedGuilds = new AllowedGuilds();
|
||||
|
||||
guildAPIRouter.get("/guilds/available", async (req, res) => {
|
||||
const guilds = await allowedGuilds.getForDashboardUser(req.user.userId);
|
||||
res.end(guilds);
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue