-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroutes.js
More file actions
24 lines (20 loc) · 901 Bytes
/
routes.js
File metadata and controls
24 lines (20 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module.exports = (app) => {
var restify = require('restify');
var scoreboard = require('./controllers/scoreboardController')
app.get('/', restify.serveStatic({
directory: __dirname + '/client',
file: 'index.html'
}));
app.get(/\/js\/?.*/, restify.serveStatic({
directory: __dirname + '/client/js',
file: 'main.min.js'
}));
app.post('/scoreboard', scoreboard.createScoreboard);
app.get('/scoreboard', scoreboard.getScoreboards);
app.get('/scoreboard/:id', scoreboard.getScoreboard);
app.put('/scoreboard/:id', scoreboard.updateScoreboard);
app.del('/scoreboard/:id', scoreboard.deleteScoreboard);
app.post('/scoreboard/:scoreboardId/participant', scoreboard.addParticipant);
app.put('/scoreboard/:scoreboardId/participant/:id', scoreboard.updateParticipant);
app.del('/scoreboard/:scoreboardId/participant/:id', scoreboard.removeParticipant);
};