Commit 45c8051b authored by Yoon, Daeki's avatar Yoon, Daeki 😅
Browse files

형식 조정

parent 77af16fc
...@@ -4,17 +4,17 @@ const Notice = require('../models/notice'); ...@@ -4,17 +4,17 @@ const Notice = require('../models/notice');
const router = express.Router(); const router = express.Router();
router.get('/', function (req, res, next) { router.get('/', function (req, res, next) {
Notice.find({}).sort({ post_date: -1 }) Notice.find({}).sort({ post_date: -1 })
.then((notices) => { .then((notices) => {
res.status(201).json(notices); res.status(201).json(notices);
}) })
.catch((err) => { .catch((err) => {
console.error(err); console.error(err);
next(err); next(err);
}); });
// res.status(404).json({error:"없음."}) // res.status(404).json({error:"없음."})
res.status(201).json(notices); res.status(201).json(notices);
}); });
module.exports = router; module.exports = router;
\ No newline at end of file
const express = require('express'); const express = require('express')
// const path = require('path');
// const multer = require('multer');
// const fs = require('fs');
const Notice = require('../models/notice'); const Notice = require('../models/notice');
const router = express.Router(); const router = express.Router();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment