Toggle navigation
Toggle navigation
This project
Loading...
Sign in
201side
/
floater
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
3
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
robin*
2020-12-10 10:34:01 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
526ec1485d8b4d1a80e5f0039b3fa3fdb4b7ef6f
526ec148
1 parent
2de70baf
해시 기반 작성자 db에 추가
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
src/routes/board.js
src/routes/board.js
View file @
526ec14
const
app
=
require
(
'../server'
);
const
db
=
require
(
'../db'
);
const
hash
=
require
(
'../hash'
);
app
.
get
(
'/'
,
async
(
req
,
res
)
=>
{
res
.
render
(
'boardlist'
,
{
boards
:
await
db
.
get
(
'board'
).
find
()});
...
...
@@ -23,5 +24,6 @@ app.post('/board/:bid', async(req, res) => {
res
.
status
(
404
).
send
(
'그런 판은 우리에게 있을 수 없어.'
);
}
let
thread
=
await
db
.
get
(
'thread'
).
insert
({
board
:
board
.
_id
,
title
:
req
.
body
.
title
,
content
:
req
.
body
.
content
,
lastUpdated
:
Date
.
now
(),
count
:
1
});
await
db
.
get
(
'thread'
).
update
(
thread
.
_id
,
{
$set
:
{
writer
:
hash
(
thread
.
_id
,
req
.
ip
)}});
res
.
redirect
(
'/thread/'
+
thread
.
_id
);
});
...
...
Please
register
or
login
to post a comment