Heo

Html 초기화면 설정변경

...@@ -12,8 +12,12 @@ app.locals.pretty=true; ...@@ -12,8 +12,12 @@ app.locals.pretty=true;
12 // app.set('view engine','pug'); 12 // app.set('view engine','pug');
13 13
14 app.use(express.static('public')); 14 app.use(express.static('public'));
15 -var http = require('http'); 15 +var HTTPS = require('http');
16 var fs = require('fs'); 16 var fs = require('fs');
17 +const path = require('path');
18 +const domain = "도메인 변경"
19 + const sslport = 23023;
20 +
17 21
18 //?page=페이지번호&?perPage=페이지당 데이터수 22 //?page=페이지번호&?perPage=페이지당 데이터수
19 const $base_url = `https://api.odcloud.kr/api/apnmOrg/v1/list`; 23 const $base_url = `https://api.odcloud.kr/api/apnmOrg/v1/list`;
...@@ -96,3 +100,18 @@ app.listen(3000,function(){ ...@@ -96,3 +100,18 @@ app.listen(3000,function(){
96 console.log('Connected 3000 port!'); 100 console.log('Connected 3000 port!');
97 }); 101 });
98 102
103 +try {
104 +const opion = {
105 +ca: fs.readFileSync('/etc/letsencrypt/live/' + domain +'/fullchain.pem'),
106 +key: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/privkey.pem'), 'utf8').toString(),
107 +cert: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/cert.pem'), 'utf8').toString(),
108 +};
109 +HTTPS.createServer(option, app).listen(sslport, () => {
110 + console.log(`[HTTPS] Server is started on port ${sslport}`);
111 + });
112 + } catch (error) {
113 + console.log('[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.');
114 + console.log(error);
115 +}
116 +
117 +
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
30 </form> 30 </form>
31 </center> 31 </center>
32 32
33 - <div id="map" style="width:1300px;height:750px; margin-left:100px; float:left; " ></div> 33 + <div id="map" style="width:1300px;height:750px; margin-left:100px; float:left; border: 3px solid; " ></div>
34 <script type="text/javascript" src="https://dapi.kakao.com/v2/maps/sdk.js?appkey=35fccf4b4e2a3179187346f26ed3f988&libraries=services"></script> 34 <script type="text/javascript" src="https://dapi.kakao.com/v2/maps/sdk.js?appkey=35fccf4b4e2a3179187346f26ed3f988&libraries=services"></script>
35 35
36 <% if(typeof(info) != "undefined"){ %> 36 <% if(typeof(info) != "undefined"){ %>
...@@ -158,6 +158,16 @@ ...@@ -158,6 +158,16 @@
158 } 158 }
159 } 159 }
160 </script> 160 </script>
161 +<% }else{ %>
162 + <script>//입력 값이 없을 때 기본 지도 띄움
163 + var mapContainer = document.getElementById('map'), // 지도를 표시할 div
164 + mapOption = {
165 + center: new kakao.maps.LatLng(37.596672, 127.051950), // 지도의 중심좌표
166 + level: 3 // 지도의 확대 레벨
167 + };
168 +
169 + var map = new kakao.maps.Map(mapContainer, mapOption); // 지도를 생성합니다
170 + </script>
161 <% } %> 171 <% } %>
162 </body> 172 </body>
163 </html> 173 </html>
...\ No newline at end of file ...\ No newline at end of file
......