Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
reservation-service
Commits
45c8051b
Commit
45c8051b
authored
Nov 06, 2020
by
Yoon, Daeki
😅
Browse files
형식 조정
parent
77af16fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/routes/notices.js
View file @
45c8051b
...
@@ -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
server/routes/writes.js
View file @
45c8051b
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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment