홍지윤

api key conceal 2

1 +Map_Key = "https://maps.googleapis.com/maps/api/js?key=AIzaSyDK6K4iDdo9cKQdrNoOJaaYg29nEG0BIjw&callback=initMap&libraries=&v=weekly"
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
13 "bcryptjs": "^2.4.3", 13 "bcryptjs": "^2.4.3",
14 "body-parser": "^1.19.0", 14 "body-parser": "^1.19.0",
15 "connect-flash": "^0.1.1", 15 "connect-flash": "^0.1.1",
16 + "dotenv": "^10.0.0",
16 "ejs": "^3.1.6", 17 "ejs": "^3.1.6",
17 "express": "^4.17.1", 18 "express": "^4.17.1",
18 "express-session": "^1.17.1", 19 "express-session": "^1.17.1",
......
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 + <script>
5 + import dotenv from "dotenv";
6 + dotenv.config();
7 + </script>
4 <title>Geocoding Service</title> 8 <title>Geocoding Service</title>
5 <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script> 9 <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
6 <style type="text/css"> 10 <style type="text/css">
...@@ -135,7 +139,7 @@ ...@@ -135,7 +139,7 @@
135 139
136 <!-- Async script executes immediately and must be after any DOM elements used in callback. --> 140 <!-- Async script executes immediately and must be after any DOM elements used in callback. -->
137 <script 141 <script
138 - src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDK6K4iDdo9cKQdrNoOJaaYg29nEG0BIjw&callback=initMap&libraries=&v=weekly" 142 + src=process.env.Map_Key;
139 async 143 async
140 ></script> 144 ></script>
141 </body> 145 </body>
......
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 + <script>
5 + import dotenv from "dotenv";
6 + dotenv.config();
7 + API_KEY = process.env.Map_Key
8 + </script>
4 <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> 9 <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
5 <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script> 10 <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
6 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> 11 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
...@@ -142,7 +147,7 @@ ...@@ -142,7 +147,7 @@
142 147
143 <!-- Async script executes immediately and must be after any DOM elements used in callback. --> 148 <!-- Async script executes immediately and must be after any DOM elements used in callback. -->
144 <script 149 <script
145 - src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDK6K4iDdo9cKQdrNoOJaaYg29nEG0BIjw&callback=initMap&libraries=&v=weekly" 150 + src=API_KEY
146 async 151 async
147 ></script> 152 ></script>
148 153
......