Toggle navigation
Toggle navigation
This project
Loading...
Sign in
오지민
/
HomePurchaseAgePrediction
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
Ojimin
2021-06-09 23:57:23 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ee1fa799153ba9a607cc07aa737d8eb6731b145d
ee1fa799
1 parent
62802305
Position data to client
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
server.js
server.js
View file @
ee1fa79
...
...
@@ -5,6 +5,7 @@ const HTTPS = require("https");
const
mysql
=
require
(
'mysql'
);
var
address
;
var
json_data
=
[];
const
app
=
express
();
const
domain
=
"2020105635.oss2021.tk"
;
...
...
@@ -19,23 +20,27 @@ app.use(express.static(path.join(__dirname, "public")));
mysqlConObj
.
open
(
db
);
//db 연결
db
.
query
(
'SELECT * FROM csvdata.csvdata'
,
function
(
error
,
results
,
fields
)
{
if
(
error
)
{
throw
(
error
);
}
console
.
log
(
results
.
length
);
});
app
.
get
(
"/"
,
function
(
req
,
res
)
{
res
.
sendFile
(
path
.
join
(
__dirname
+
"/main.html"
));
});
app
.
get
(
"/geolocation"
,
function
(
req
,
res
)
{
address
=
req
.
query
.
address
;
console
.
log
(
address
);
db
.
query
(
'SELECT * FROM csvdata.csvdata'
,
function
(
error
,
results
,
fields
)
{
if
(
error
)
{
console
.
log
(
"ERROR!!"
);
}
for
(
var
i
=
0
;
i
<
results
.
length
;
i
++
){
if
(
results
[
i
].
city_country
==
address
){
json_data
.
push
(
results
[
i
]);
}
}
res
.
send
(
json_data
);
});
res
.
sendFile
(
path
.
join
(
__dirname
+
"/kakao/kakaomap.html"
));
});
try
{
const
option
=
{
ca
:
fs
.
readFileSync
(
"/etc/letsencrypt/live/"
+
domain
+
"/fullchain.pem"
),
...
...
Please
register
or
login
to post a comment