Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최시원
/
Singer-Composer
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Mukho
2021-11-16 14:03:38 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
76cce0c67f41025ddb10fa2dd9efa67c4224fec7
76cce0c6
1 parent
4b449bc5
Update Title
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
31 deletions
public/login.html
readme.md
router/board/index.js
views/list.ejs
views/login.ejs
views/main.ejs
views/register.ejs
public/login.html
View file @
76cce0c
...
...
@@ -26,6 +26,7 @@
</div>
</nav>
<div
class=
"container px-5 my-5"
>
<h2>
로그인
</h2>
<form
action=
"/login"
method=
"post"
id=
"contactForm"
data-sb-form-api-token=
"API_TOKEN"
>
<div
class=
"form-floating mb-3"
>
<input
class=
"form-control"
name=
"ID"
id=
"ID"
type=
"text"
required
minlength=
'1'
maxlength=
'20'
placeholder=
"ID"
data-sb-validations=
"required"
/>
...
...
readme.md
View file @
76cce0c
...
...
@@ -24,4 +24,4 @@ DB 구조(*ID, password, type) -> 형식에 맞게 추가<br>
LF 오류시 git config --global core.autocrlf true 입력
<br><br>
최종 수정: 2021-11-15 21:30
\ No newline at end of file
최종 수정: 2021-11-16 14:03
\ No newline at end of file
...
...
router/board/index.js
View file @
76cce0c
...
...
@@ -13,8 +13,9 @@ router.get('/:page', function(req, res, next) {
board
.
query
(
sql
,
function
(
err
,
rows
)
{
if
(
err
)
console
.
error
(
"err : "
+
err
);
res
.
render
(
'list.ejs'
,
{
title
:
'게시판 리스트'
,
rows
:
rows
})
var
id
=
req
.
user
;
if
(
!
id
)
id
=
"수정예정"
res
.
render
(
'list.ejs'
,
{
'ID'
:
id
,
title
:
'게시판 리스트'
,
rows
:
rows
})
})
});
...
...
views/list.ejs
View file @
76cce0c
<!DOCTYPE html>
<html>
<head>
<title>
<
%= title %>
</title>
<title>
묵호 - 놀이터
</title>
<!-- Favicon-->
<link
rel=
"icon"
type=
"image/x-icon"
href=
"../assets/favicon.ico"
/>
<link
rel=
'stylesheet'
href=
'/stylesheets/style.css'
/>
</head>
<body>
<h1>
<
%= title %>
</h1>
<a
href=
"/board/write"
>
글쓰기
</a>
<table
border=
"1"
>
<tr>
<td>
번호
</td>
<td>
작성자
</td>
<td>
제목
</td>
<td>
조회수
</td>
<td>
수정일
</td>
<td>
등록일
</td>
</tr>
<
%
for(var i=0; i
<rows
.
length
;
i
++)
{
var
data =
rows[i];
%
>
<tr>
<td>
<
%=data.idx%>
</td>
<td>
<
%=data.name%>
</td>
<td><a
href=
"/board/read/<%=data.idx%>"
>
<
%=data.title%>
</a></td>
<td>
<
%=data.hit%>
</td>
<td>
<
%=data.modidate%>
</td>
<td>
<
%=data.regdate%>
</td>
</tr>
<
%}%>
</table>
<!-- Navigation-->
<nav
class=
"navbar navbar-light bg-light static-top"
>
<div
class=
"container"
>
<a
class=
"navbar-brand"
href=
"http://localhost:3000/main"
>
묵호의 놀이터
</a>
<div
class=
"user"
>
<a>
<
%= ID %> 님 안녕하세요
</section></a>
<a
class=
"btn btn-primary"
href=
"http://localhost:3000/logout"
>
로그아웃
</a>
</div>
</div>
</nav>
<h1>
<
%= title %>
</h1>
<a
href=
"/board/write"
>
글쓰기
</a>
<table
border=
"1"
>
<tr>
<td>
번호
</td>
<td>
작성자
</td>
<td>
제목
</td>
<td>
조회수
</td>
<td>
수정일
</td>
<td>
등록일
</td>
</tr>
<
%
for(var i=0; i
<rows
.
length
;
i
++)
{
var
data =
rows[i];
%
>
<tr>
<td>
<
%=data.idx%>
</td>
<td>
<
%=data.name%>
</td>
<td><a
href=
"/board/read/<%=data.idx%>"
>
<
%=data.title%>
</a></td>
<td>
<
%=data.hit%>
</td>
<td>
<
%=data.modidate%>
</td>
<td>
<
%=data.regdate%>
</td>
</tr>
<
%}%>
</table>
</body>
</html>
...
...
views/login.ejs
View file @
76cce0c
...
...
@@ -26,6 +26,7 @@
</div>
</nav>
<div
class=
"container px-5 my-5"
>
<h2>
로그인
</h2>
<form
action=
"/login"
method=
"post"
id=
"contactForm"
data-sb-form-api-token=
"API_TOKEN"
>
<div
class=
"form-floating mb-3"
>
<input
class=
"form-control"
name=
"ID"
id=
"ID"
type=
"text"
required
minlength=
'1'
maxlength=
'20'
placeholder=
"ID"
data-sb-validations=
"required"
/>
...
...
views/main.ejs
View file @
76cce0c
...
...
@@ -21,7 +21,7 @@
<div
class=
"container"
>
<a
class=
"navbar-brand"
href=
"http://localhost:3000/main"
>
묵호의 놀이터
</a>
<div
class=
"user"
>
<a>
<
%= ID %> 님 안녕하세요
</
section></
a>
<a>
<
%= ID %> 님 안녕하세요
</a>
<a
class=
"btn btn-primary"
href=
"http://localhost:3000/logout"
>
로그아웃
</a>
</div>
</div>
...
...
views/register.ejs
View file @
76cce0c
...
...
@@ -26,6 +26,7 @@
</div>
</nav>
<div
class=
"container px-5 my-5"
>
<h2>
회원가입
</h2>
<form
action=
"/register"
method=
"post"
id=
"contactForm"
data-sb-form-api-token=
"API_TOKEN"
>
<div
class=
"form-floating mb-3"
>
<input
class=
"form-control"
name=
"ID"
id=
"ID"
type=
"text"
required
minlength=
'1'
maxlength=
'20'
placeholder=
"ID"
data-sb-validations=
"required"
/>
...
...
Please
register
or
login
to post a comment