robin*

판 리스트 get 구현

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) {
......