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
Ubuntu
2020-12-10 19:24:53 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0da201e0d367b4eb2fdda09be9fa0c2d8ba6a2f3
0da201e0
1 parent
41de7c1a
배포 중파일 오류 수정
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
17 deletions
app.js
package-lock.json
package.json
routes/db.js
routes/mapPage.ejs
app.js
View file @
0da201e
const
express
=
require
(
'express'
);
const
path
=
require
(
'path'
);
const
app
=
express
();
var
url
=
require
(
'url'
);
const
HTTPS
=
require
(
'https'
);
const
url
=
require
(
'url'
);
require
(
'dotenv'
).
config
();
//화면 별 router 연결, 라우터 호출해서 페이지를 불러오는데 사용함.
var
mainRouter
=
require
(
'./routes'
)
//호출시 index.js 실행 (main.js : title 할당하고 main.html 열어줌)
const
mainRouter
=
require
(
'./routes'
)
//호출시 index.js 실행 (main.js : title 할당하고 main.html 열어줌)
const
domain
=
"www.culturegallery.ml"
const
sslport
=
23023
;
//디폴트 포트 값 : 8000
app
.
set
(
'port'
,
process
.
env
.
PORT
||
23023
);
...
...
@@ -28,11 +30,17 @@ app.get("/find", function (req, res) {
res
.
send
(
querystring
.
word
);
});
app
.
get
(
'/logout'
,
function
(
req
,
res
)
{
res
.
send
(
"Logout success"
);
});
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
(),
};
app
.
listen
(
app
.
get
(
'port'
)
,
()
=>
{
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
);
}
...
...
package-lock.json
View file @
0da201e
This diff is collapsed. Click to expand it.
package.json
View file @
0da201e
...
...
@@ -18,6 +18,7 @@
"dotenv"
:
"^8.2.0"
,
"ejs"
:
"^3.1.5"
,
"express"
:
"^4.17.1"
,
"mysql"
:
"^2.18.1"
"mysql"
:
"^2.18.1"
,
"mysql2"
:
"^2.2.5"
}
}
...
...
routes/db.js
View file @
0da201e
var
mysql
=
require
(
'mysql'
);
var
database
=
mysql
.
createConnection
({
host
:
process
.
env
.
HOST
,
user
:
process
.
env
.
USER
,
password
:
process
.
env
.
PASSWORD
,
host
:
"culturegallery.cm2bwcuyukrm.us-east-1.rds.amazonaws.com"
,
user
:
"root"
,
password
:
"dldbwp1207"
,
port
:
3306
,
database
:
"showdata"
});
...
...
routes/mapPage.ejs
View file @
0da201e
...
...
@@ -3,10 +3,7 @@
<head>
<title>
<
%= title%>
<script>
</script>
<script>
title
</script>
</title>
<link
rel=
"stylesheet"
href=
'/stylesheets/mapPage_style.css'
type=
"text/css"
>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
>
...
...
Please
register
or
login
to post a comment