Toggle navigation
Toggle navigation
This project
Loading...
Sign in
SUJINKO(고수진)
/
abroad-checkup-project
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
SUJINKO(고수진)
2020-12-10 10:37:56 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8ff9814bc2c1a82cacbe202ba3f317db6cd16b78
8ff9814b
1 parent
8e0fdaa0
Delete main.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
63 deletions
main.js
main.js
deleted
100644 → 0
View file @
8e0fdaa
var
http
=
require
(
'http'
);
var
fs
=
require
(
'fs'
);
var
url
=
require
(
'url'
);
var
request
=
require
(
'request'
);
var
url2
=
'http://apis.data.go.kr/1262000/SafetyNewsList/getCountrySafetyNewsList'
;
var
queryParams
=
`?
${
encodeURIComponent
(
'ServiceKey'
)}
=QTUBzVkK3FBFd0%2BLeWBpzJMZnUSZTn7xB1teg2G%2BcSHr9MxC3QMi1UxrA%2FFg%2FvkZgFBKxmt34D5YTQeunsRrYg%3D%3D`
;
/* Service Key*/
queryParams
+=
'&'
+
encodeURIComponent
(
'numOfRows'
)
+
'='
+
encodeURIComponent
(
'10'
);
/* */
queryParams
+=
'&'
+
encodeURIComponent
(
'pageNo'
)
+
'='
+
encodeURIComponent
(
'1'
);
/* */
queryParams
+=
'&'
+
encodeURIComponent
(
'title1'
)
+
'='
+
encodeURIComponent
(
'입국'
);
/* */
queryParams
+=
'&'
+
encodeURIComponent
(
'title2'
)
+
'='
+
encodeURIComponent
(
'코로나'
);
/* */
queryParams
+=
'&'
+
encodeURIComponent
(
'title3'
)
+
'='
+
encodeURIComponent
(
'운항'
);
/* */
queryParams
+=
'&'
+
encodeURIComponent
(
'title4'
)
+
'='
+
encodeURIComponent
(
'항공권'
);
/* */
queryParams
+=
'&'
+
encodeURIComponent
(
'title5'
)
+
'='
+
encodeURIComponent
(
'격리'
);
/* */
request
({
url
:
url2
+
queryParams
,
method
:
'GET'
},
function
(
error
,
response
,
body
)
{
//console.log('Status', response.statusCode);
//console.log('Headers', JSON.stringify(response.headers));
//console.log('Reponse received', body);
});
var
app
=
http
.
createServer
(
function
(
request
,
response
){
var
_url
=
request
.
url
;
var
queryData
=
url
.
parse
(
url2
,
true
).
query
;
if
(
request
.
url
==
'/'
){
url
=
'/index.html'
;
}
if
(
request
.
url
==
'/favicon.ico'
){
return
response
.
writeHead
(
404
);
}
response
.
writeHead
(
200
);
var
template
=
`
<!doctype html>
<html>
<head>
<title>어디로 가시나요? 해외로검진표!</title>
<meta charset="utf-8">
</head>
<body>
<h1>해외로검진표</h1>
<p>당신이 가고 싶은 곳, 지금 떠날 수 있을까요?
</p>
<form>
<div>어디로 가시나요? <br/> <input type type="text" name="3_destination" value=""> </div>
</form>
<div>
<div>
${
queryData
.}
</div>
</div>
</body>
</html>
`
;
});
app
.
listen
(
3000
);
Please
register
or
login
to post a comment