Showing
1 changed file
with
3 additions
and
0 deletions
1 | const app = require('./server'); | 1 | const app = require('./server'); |
2 | const db = require('./db'); | 2 | const db = require('./db'); |
3 | 3 | ||
4 | +app.get('/board', async(req, res) => { | ||
5 | + res.json({boards: await db.get('board').find()}); | ||
6 | +}) | ||
4 | app.get('/board/:bid', async(req, res) => { | 7 | app.get('/board/:bid', async(req, res) => { |
5 | let board = await db.get('board').findOne({name: req.params.bid}); | 8 | let board = await db.get('board').findOne({name: req.params.bid}); |
6 | if(!board) { | 9 | if(!board) { | ... | ... |
-
Please register or login to post a comment