Showing
2 changed files
with
7 additions
and
2 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) => { | 4 | +app.get('/', async(req, res) => { |
5 | - res.json({boards: await db.get('board').find()}); | 5 | + res.render('boardlist', {boards: await db.get('board').find()}); |
6 | }) | 6 | }) |
7 | app.get('/board/:bid', async(req, res) => { | 7 | app.get('/board/:bid', async(req, res) => { |
8 | let board = await db.get('board').findOne({name: req.params.bid}); | 8 | let board = await db.get('board').findOne({name: req.params.bid}); | ... | ... |
-
Please register or login to post a comment