Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정승우
/
YaguMoa
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
SW0000J
2020-06-14 17:32:25 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
60ac9992c265cf0dd7eae3d8633e295b71fd17da
60ac9992
1 parent
6378f3f1
testapp.js의 json list 오류
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
testcode/testlist.js
testcode/testlist.js
0 → 100644
View file @
60ac999
var
express
=
require
(
'express'
);
var
app
=
express
();
var
bodyParser
=
require
(
'body-parser'
);
var
fs
=
require
(
'fs'
);
const
PORT
=
80
;
const
xports
=
require
(
'./test1.js'
);
const
zum
=
require
(
'./test2.js'
);
const
chosun
=
require
(
'./test3.js'
);
const
yna
=
require
(
'./test4.js'
);
//console.log(xports.xports);
//console.log(zum.zum);
//console.log(chosun.chosun);
//console.log(yna.yna);
app
.
get
(
'/'
,
function
(
req
,
res
){
var
newslist
=
''
;
var
newsobject
=
xports
.
xports
;
console
.
log
(
newsobject
[
0
].
url
);
for
(
var
i
=
0
;
i
<
newsobject
.
length
;
i
++
){
newslist
=
newslist
+
`
<li>
<div class='item'>
<div class='info'>
<span class='time'>
${
newsobject
[
i
].
datetime
}
</span>
</div>
<div class='img'>
<a>
<img src =
${
newsobject
[
i
].
image_url
}
>
</a>
</div>
<div class='news'>
<a href =
${
newsobject
[
i
].
url
}
>
<strong>
${
newsobject
[
i
].
title
}
</strong>
</a>
<p>
${
newsobject
[
i
].
summary
}
</p>
</div>
</div>
</li>`
;
}
var
html
=
`
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ossswoo.tk</title>
</head>
<body>
<div class = 'main'>
<div class = 'center'>
<div>
${
newslist
}
</div>
</div>
</div>
</body>
</html>`
;
res
.
send
(
html
);
});
app
.
listen
(
PORT
,
function
(){
console
.
log
(
'Code run in https://localhost:'
+
PORT
);
});
\ No newline at end of file
Please
register
or
login
to post a comment