Toggle navigation
Toggle navigation
This project
Loading...
Sign in
신원형
/
study-or-enjoy
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
김연우
2022-06-05 20:53:30 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
35d4e5061737a25bdf8479c9555ce10064b6fa73
35d4e506
1 parent
132cedc4
modify read_csv
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
24 deletions
read_csv.js
read_csv.js
View file @
35d4e50
...
...
@@ -129,7 +129,31 @@ app.post('/hook', function (req, res) {
}
res
.
sendStatus
(
200
);
chooseFile
=
function
()
{
chooseFile
();
});
try
{
const
option
=
{
ca
:
fs
.
readFileSync
(
'/etc/letsencrypt/live/'
+
domain
+
'/fullchain.pem'
),
key
:
fs
.
readFileSync
(
path
.
resolve
(
process
.
cwd
(),
'/etc/letsencrypt/live/'
+
domain
+
'/privkey.pem'
),
'utf8'
).
toString
(),
cert
:
fs
.
readFileSync
(
path
.
resolve
(
process
.
cwd
(),
'/etc/letsencrypt/live/'
+
domain
+
'/cert.pem'
),
'utf8'
).
toString
(),
};
HTTPS
.
createServer
(
option
,
app
).
listen
(
sslport
,
()
=>
{
console
.
log
(
`[HTTPS] Server is started on port
${
sslport
}
`
);
});
}
catch
(
error
)
{
console
.
log
(
'[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.'
);
console
.
log
(
error
);
}
const
csv
=
require
(
'csv-parser'
)
const
results
=
[];
chooseFile
=
function
()
{
if
(
destCar
==
"cafe"
)
{
fs
.
createReadStream
(
'cafe_list.csv'
)
.
pipe
(
csv
())
...
...
@@ -163,26 +187,3 @@ app.post('/hook', function (req, res) {
});
}
}
\ No newline at end of file
chooseFile
();
});
try
{
const
option
=
{
ca
:
fs
.
readFileSync
(
'/etc/letsencrypt/live/'
+
domain
+
'/fullchain.pem'
),
key
:
fs
.
readFileSync
(
path
.
resolve
(
process
.
cwd
(),
'/etc/letsencrypt/live/'
+
domain
+
'/privkey.pem'
),
'utf8'
).
toString
(),
cert
:
fs
.
readFileSync
(
path
.
resolve
(
process
.
cwd
(),
'/etc/letsencrypt/live/'
+
domain
+
'/cert.pem'
),
'utf8'
).
toString
(),
};
HTTPS
.
createServer
(
option
,
app
).
listen
(
sslport
,
()
=>
{
console
.
log
(
`[HTTPS] Server is started on port
${
sslport
}
`
);
});
}
catch
(
error
)
{
console
.
log
(
'[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.'
);
console
.
log
(
error
);
}
const
csv
=
require
(
'csv-parser'
)
const
results
=
[];
...
...
Please
register
or
login
to post a comment