Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이유제
/
CultureGallery
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
송효섭
2020-12-11 11:02:49 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a820ec5e17fc123d4b55ab2cdce1449b3d0187ef
a820ec5e
1 parent
0da201e0
배포용 app.js 수정
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
19 deletions
app.js
app.js
View file @
a820ec5
const
express
=
require
(
'express'
);
const
path
=
require
(
'path'
);
const
app
=
express
();
const
HTTPS
=
require
(
'https
'
);
const
url
=
require
(
'url'
);
var
bodyparser
=
require
(
'body-parser
'
);
var
url
=
require
(
'url'
);
require
(
'dotenv'
).
config
();
//화면 별 router 연결, 라우터 호출해서 페이지를 불러오는데 사용함.
const
mainRouter
=
require
(
'./routes'
)
//호출시 index.js 실행 (main.js : title 할당하고 main.html 열어줌)
const
domain
=
"www.culturegallery.ml"
const
sslport
=
23023
;
var
mainRouter
=
require
(
'./routes'
)
//호출시 index.js 실행 (main.js : title 할당하고 main.html 열어줌)
//디폴트 포트 값 : 8000
app
.
set
(
'port'
,
process
.
env
.
PORT
||
23023
);
...
...
@@ -30,17 +29,11 @@ app.get("/find", function (req, res) {
res
.
send
(
querystring
.
word
);
});
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
(
`Server is running at
${
app
.
get
(
'port'
)}
`
);
});
}
catch
(
error
)
{
console
.
log
(
'[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.'
);
console
.
warn
(
error
);
}
app
.
get
(
'/logout'
,
function
(
req
,
res
)
{
res
.
send
(
"Logout success"
);
});
app
.
listen
(
app
.
get
(
'port'
),
()
=>
{
console
.
log
(
`Server is running at
${
app
.
get
(
'port'
)}
`
);
});
\ No newline at end of file
...
...
Please
register
or
login
to post a comment