Slight restructure, updated auth, implement player and game endpoints
This commit is contained in:
17
src/routes/game.ts
Normal file
17
src/routes/game.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { guard } from '../utilities/guard';
|
||||
import { Claims } from '../orm/claims';
|
||||
import games from '../endpoints/games';
|
||||
|
||||
export default {
|
||||
'/api/game': {
|
||||
POST: guard(games.create, [Claims.ADMIN, Claims.GAMES.CREATE]),
|
||||
},
|
||||
'/api/game/:id': {
|
||||
GET: guard(games.get, [Claims.ADMIN, Claims.GAMES.READ]),
|
||||
PATCH: guard(games.update, [Claims.ADMIN, Claims.GAMES.UPDATE]),
|
||||
DELETE: guard(games.drop, [Claims.ADMIN, Claims.GAMES.DELETE]),
|
||||
},
|
||||
'/api/game/search/:query': {
|
||||
GET: guard(games.query, [Claims.ADMIN, Claims.GAMES.READ]),
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user