Showing
4 changed files
with
57 additions
and
183 deletions
.package.swp
0 → 100644
No preview for this file type
1 | -다음 우편번호 서비스 api를 통해 사용자로부터 주소를 작성하면 이를 영문주소로 변환해준다. | ||
2 | - | ||
3 | -이때 아마존, 뉴에그, 알리익스프레스, 이베이, 페이팔 등에서 작성하는 영어주소 양식에 맞게 각각 출력하여 주소 작성에 용이하게 해준다. | ||
4 | - | ||
5 | - | ||
6 | -추후에 해외직구 가격 비교기능을 추가하는 것도 괜찮을지도? | ||
7 | - | ||
8 | - | ||
9 | -참고: http://postcode.map.daum.net/guide | ||
10 | - | ||
11 | - | ||
12 | -<!-- | ||
13 | -*** Thanks for checking out this README Template. If you have a suggestion that would | ||
14 | -*** make this better, please fork the repo and create a pull request or simply open | ||
15 | -*** an issue with the tag "enhancement". | ||
16 | -*** Thanks again! Now go create something AMAZING! :D | ||
17 | ---> | ||
18 | - | ||
19 | - | ||
20 | - | ||
21 | - | ||
22 | - | ||
23 | -<!-- PROJECT SHIELDS --> | ||
24 | -<!-- | ||
25 | -*** I'm using markdown "reference style" links for readability. | ||
26 | -*** Reference links are enclosed in brackets [ ] instead of parentheses ( ). | ||
27 | -*** See the bottom of this document for the declaration of the reference variables | ||
28 | -*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use. | ||
29 | -*** https://www.markdownguide.org/basic-syntax/#reference-style-links | ||
30 | ---> | ||
31 | -[![Contributors][contributors-shield]][contributors-url] | ||
32 | -[![Forks][forks-shield]][forks-url] | ||
33 | -[![Stargazers][stars-shield]][stars-url] | ||
34 | -[![Issues][issues-shield]][issues-url] | ||
35 | -[![MIT License][license-shield]][license-url] | ||
36 | -[![LinkedIn][linkedin-shield]][linkedin-url] | ||
37 | - | ||
38 | - | ||
39 | - | ||
40 | -<!-- PROJECT LOGO --> | ||
41 | <br /> | 1 | <br /> |
42 | <p align="center"> | 2 | <p align="center"> |
43 | - <a href="https://github.com/othneildrew/Best-README-Template"> | 3 | + <h3 align="center">Amazon_Shopping_Helper</h3> |
44 | - <img src="images/logo.png" alt="Logo" width="80" height="80"> | ||
45 | - </a> | ||
46 | - | ||
47 | - <h3 align="center">Best-README-Template</h3> | ||
48 | 4 | ||
49 | <p align="center"> | 5 | <p align="center"> |
50 | - An awesome README template to jumpstart your projects! | 6 | + 해외직구가 처음인 사람에게 도움을! |
51 | <br /> | 7 | <br /> |
52 | - <a href="https://github.com/othneildrew/Best-README-Template"><strong>Explore the docs »</strong></a> | ||
53 | <br /> | 8 | <br /> |
54 | <br /> | 9 | <br /> |
55 | - <a href="https://github.com/othneildrew/Best-README-Template">View Demo</a> | ||
56 | - · | ||
57 | - <a href="https://github.com/othneildrew/Best-README-Template/issues">Report Bug</a> | ||
58 | - · | ||
59 | - <a href="https://github.com/othneildrew/Best-README-Template/issues">Request Feature</a> | ||
60 | </p> | 10 | </p> |
61 | </p> | 11 | </p> |
62 | 12 | ||
63 | 13 | ||
64 | - | ||
65 | -<!-- TABLE OF CONTENTS --> | ||
66 | ## Table of Contents | 14 | ## Table of Contents |
67 | 15 | ||
68 | -* [About the Project](#about-the-project) | 16 | +* [About the Project](## 프로그램 설명) |
69 | - * [Built With](#built-with) | 17 | +* [Built With](## 프로그램 시연 주소) |
70 | -* [Getting Started](#getting-started) | 18 | +* [Getting Started](## 프로그램 설치 방법) |
71 | - * [Prerequisites](#prerequisites) | 19 | + * [Contributing](### 사전 준비물) |
72 | - * [Installation](#installation) | 20 | + * [License](### 프로그램 실행) |
73 | -* [Usage](#usage) | 21 | +* [Prerequisites](## 자기 평가) |
74 | -* [Roadmap](#roadmap) | 22 | +* [License](## License) |
75 | -* [Contributing](#contributing) | 23 | +* [Contact](## Contact) |
76 | -* [License](#license) | 24 | +* [Contact](## 참고사항) |
77 | -* [Contact](#contact) | ||
78 | -* [Acknowledgements](#acknowledgements) | ||
79 | - | ||
80 | - | ||
81 | - | ||
82 | -<!-- ABOUT THE PROJECT --> | ||
83 | -## About The Project | ||
84 | - | ||
85 | -[![Product Name Screen Shot][product-screenshot]](https://example.com) | ||
86 | - | ||
87 | -There are many great README templates available on GitHub, however, I didn't find one that really suit my needs so I created this enhanced one. I want to create a README template so amazing that it'll be the last one you ever need. | ||
88 | - | ||
89 | -Here's why: | ||
90 | -* Your time should be focused on creating something amazing. A project that solves a problem and helps others | ||
91 | -* You shouldn't be doing the same tasks over and over like creating a README from scratch | ||
92 | -* You should element DRY principles to the rest of your life :smile: | ||
93 | - | ||
94 | -Of course, no one template will serve all projects since your needs may be different. So I'll be adding more in the near future. You may also suggest changes by forking this repo and creating a pull request or opening an issue. | ||
95 | 25 | ||
96 | -A list of commonly used resources that I find helpful are listed in the acknowledgements. | 26 | +## 프로그램 설명 |
97 | 27 | ||
98 | -### Built With | 28 | +해외직구가 처음인 사람에게 도움이 될 수 있는 프로그램을 목표로 구상되었다. |
99 | -This section should list any major frameworks that you built your project using. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples. | ||
100 | -* [Bootstrap](https://getbootstrap.com) | ||
101 | -* [JQuery](https://jquery.com) | ||
102 | -* [Laravel](https://laravel.com) | ||
103 | 29 | ||
30 | +지금 현재 제작된 기능은 한국 주소를 입력하면 해외쇼핑몰의 주소 작성 양식에 맞게 영문주소를 반환한다. | ||
104 | 31 | ||
105 | 32 | ||
106 | -<!-- GETTING STARTED --> | 33 | +## 프로그램 시연 주소 |
107 | -## Getting Started | ||
108 | 34 | ||
109 | -This is an example of how you may give instructions on setting up your project locally. | 35 | +["https://www.chatosscjh.tk"](https://www.chatosscjh.tk) |
110 | -To get a local copy up and running follow these simple example steps. | ||
111 | 36 | ||
112 | -### Prerequisites | 37 | +## 프로그램 설치 방법 |
113 | 38 | ||
114 | -This is an example of how to list things you need to use the software and how to install them. | 39 | +### 사전 준비물 |
115 | -* npm | 40 | +* 파파고 api가 필요하다 |
116 | -```sh | 41 | + 여기에 들어가서 api 신청을 마친다.[https://developers.naver.com/apps/#/register?api=ppg_n2mt] (https://developers.naver.com/apps/#/register?api=ppg_n2mt) |
117 | -npm install npm@latest -g | 42 | +* Application 목록에 들어가 Client ID와 Client Secret를 복사해 둔다[https://developers.naver.com/apps/#/list](https://developers.naver.com/apps/#/list) |
118 | -``` | ||
119 | 43 | ||
120 | -### Installation | 44 | + ### 프로그램 실행 |
121 | 45 | ||
122 | -1. Get a free API Key at [https://example.com](https://example.com) | 46 | +1. 이 프로그램을 다운받는다. |
123 | -2. Clone the repo | ||
124 | ```sh | 47 | ```sh |
125 | -git clone https://github.com/your_username_/Project-Name.git | 48 | +git clone ssh://git@khuhub.khu.ac.kr:12959/2019103219/Amazon_Shopping_Helper.git |
126 | ``` | 49 | ``` |
127 | -3. Install NPM packages | 50 | +2. NPM pactages를 설치한다. |
128 | ```sh | 51 | ```sh |
129 | npm install | 52 | npm install |
130 | ``` | 53 | ``` |
131 | -4. Enter your API in `config.js` | 54 | +3. app.js에 들어가서 PAPAGO_ID와 PAPAGO_SECRET에 본인의 Client ID와 Client Secret를 붇인다. |
132 | ```JS | 55 | ```JS |
133 | -const API_KEY = 'ENTER YOUR API'; | 56 | +const PAPAGO_ID = 'Client ID'; |
57 | +const PAPAGO_SECRET = 'Client Secret'; | ||
134 | ``` | 58 | ``` |
59 | +4. 프로그램을 실행한다. | ||
60 | +```sh | ||
61 | +node app.js | ||
62 | +``` | ||
63 | +5. 주소창에 localhost:23023을 친다. | ||
135 | 64 | ||
65 | +## 자기 평가 | ||
136 | 66 | ||
67 | +제작자의 미흡한 node.js, html-javascript 실력으로 인하여 계획해 두었던 기능들을 구현하지 못하였다. | ||
68 | +계획의 구상은 다음과 같았다. | ||
69 | +- 한국 주소를 영어로 번역해 주는 기능 | ||
70 | +- 해외 직구 특가를 정리해 놓는 기능(슬릭딜, 쿨엔조이, 뽐뿌 해외핫딜, 딜바다 해외핫딜 등) | ||
71 | +- 구매할 물품의 달러가격을 카드수수료를 고려하여 예상 금액을 보여주는 기능 | ||
137 | 72 | ||
138 | -<!-- USAGE EXAMPLES --> | 73 | +이중에서 구현한 기능은 첫번째 기능 뿐이다. |
139 | -## Usage | 74 | +또한 html을 처음 써보게 되어서 홈페이지 디자인이 너무 미흡하다. |
140 | - | ||
141 | -Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources. | ||
142 | - | ||
143 | -_For more examples, please refer to the [Documentation](https://example.com)_ | ||
144 | - | ||
145 | - | ||
146 | - | ||
147 | -<!-- ROADMAP --> | ||
148 | -## Roadmap | ||
149 | - | ||
150 | -See the [open issues](https://github.com/othneildrew/Best-README-Template/issues) for a list of proposed features (and known issues). | ||
151 | - | ||
152 | - | ||
153 | - | ||
154 | -<!-- CONTRIBUTING --> | ||
155 | -## Contributing | ||
156 | - | ||
157 | -Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. | ||
158 | - | ||
159 | -1. Fork the Project | ||
160 | -2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) | ||
161 | -3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) | ||
162 | -4. Push to the Branch (`git push origin feature/AmazingFeature`) | ||
163 | -5. Open a Pull Request | ||
164 | - | ||
165 | - | ||
166 | 75 | ||
167 | -<!-- LICENSE --> | ||
168 | ## License | 76 | ## License |
169 | 77 | ||
170 | -Distributed under the MIT License. See `LICENSE` for more information. | 78 | +Distributed under the Apache License ver2. See [`LICENSE`](http://khuhub.khu.ac.kr/2019103219/Amazon_Shopping_Helper/blob/master/License) for more information. |
171 | - | ||
172 | 79 | ||
173 | 80 | ||
174 | -<!-- CONTACT --> | ||
175 | ## Contact | 81 | ## Contact |
176 | 82 | ||
177 | -Your Name - [@your_twitter](https://twitter.com/your_username) - email@example.com | 83 | +장주현 - [@facebook](https://www.facebook.com/joohyun7u/) - email@example.com |
178 | - | ||
179 | -Project Link: [https://github.com/your_username/repo_name](https://github.com/your_username/repo_name) | ||
180 | - | ||
181 | - | ||
182 | - | ||
183 | -<!-- ACKNOWLEDGEMENTS --> | ||
184 | -## Acknowledgements | ||
185 | -* [GitHub Emoji Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet) | ||
186 | -* [Img Shields](https://shields.io) | ||
187 | -* [Choose an Open Source License](https://choosealicense.com) | ||
188 | -* [GitHub Pages](https://pages.github.com) | ||
189 | -* [Animate.css](https://daneden.github.io/animate.css) | ||
190 | -* [Loaders.css](https://connoratherton.com/loaders) | ||
191 | -* [Slick Carousel](https://kenwheeler.github.io/slick) | ||
192 | -* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll) | ||
193 | -* [Sticky Kit](http://leafo.net/sticky-kit) | ||
194 | -* [JVectorMap](http://jvectormap.com) | ||
195 | -* [Font Awesome](https://fontawesome.com) | ||
196 | - | ||
197 | - | ||
198 | 84 | ||
85 | +Project Link: [http://khuhub.khu.ac.kr/2019103219/Amazon_Shopping_Helper](http://khuhub.khu.ac.kr/2019103219/Amazon_Shopping_Helper) | ||
199 | 86 | ||
87 | +## 참고사항 | ||
200 | 88 | ||
201 | -<!-- MARKDOWN LINKS & IMAGES --> | 89 | +다음 우편번호 서비스: [http://postcode.map.daum.net/guide](http://postcode.map.daum.net/guide) |
202 | -<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --> | 90 | +파파고 번역: [https://developers.naver.com/docs/papago/papago-nmt-overview.md](https://developers.naver.com/docs/papago/papago-nmt-overview.md) |
203 | -[contributors-shield]: https://img.shields.io/github/contributors/othneildrew/Best-README-Template.svg?style=flat-square | ||
204 | -[contributors-url]: https://github.com/othneildrew/Best-README-Template/graphs/contributors | ||
205 | -[forks-shield]: https://img.shields.io/github/forks/othneildrew/Best-README-Template.svg?style=flat-square | ||
206 | -[forks-url]: https://github.com/othneildrew/Best-README-Template/network/members | ||
207 | -[stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=flat-square | ||
208 | -[stars-url]: https://github.com/othneildrew/Best-README-Template/stargazers | ||
209 | -[issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=flat-square | ||
210 | -[issues-url]: https://github.com/othneildrew/Best-README-Template/issues | ||
211 | -[license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=flat-square | ||
212 | -[license-url]: https://github.com/othneildrew/Best-README-Template/blob/master/LICENSE.txt | ||
213 | -[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555 | ||
214 | -[linkedin-url]: https://linkedin.com/in/othneildrew | ||
215 | -[product-screenshot]: images/screenshot.png | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -6,9 +6,10 @@ const app = express(); | ... | @@ -6,9 +6,10 @@ const app = express(); |
6 | const PAPAGO_URL = 'https://openapi.naver.com/v1/papago/n2mt' | 6 | const PAPAGO_URL = 'https://openapi.naver.com/v1/papago/n2mt' |
7 | const PAPAGO_ID = 'cIZBOTfISMHEyygh_NHp'; | 7 | const PAPAGO_ID = 'cIZBOTfISMHEyygh_NHp'; |
8 | const PAPAGO_SECRET = '8D32UNGgYp'; | 8 | const PAPAGO_SECRET = '8D32UNGgYp'; |
9 | +const path = require('path'); | ||
9 | const HTTPS = require('https'); | 10 | const HTTPS = require('https'); |
10 | const domain = "www.chatosscjh.tk" | 11 | const domain = "www.chatosscjh.tk" |
11 | -const PORT = process.env.PORT || 3000; | 12 | +const sslport = 23023; |
12 | 13 | ||
13 | //const indexRoute = require("./routes/index"); | 14 | //const indexRoute = require("./routes/index"); |
14 | app.use(bodyParser.urlencoded({extended: true})); | 15 | app.use(bodyParser.urlencoded({extended: true})); |
... | @@ -82,6 +83,7 @@ app.post('/', async function(req,res){ | ... | @@ -82,6 +83,7 @@ app.post('/', async function(req,res){ |
82 | extraaddressE = body.message.result.translatedText; | 83 | extraaddressE = body.message.result.translatedText; |
83 | } | 84 | } |
84 | }); | 85 | }); |
86 | + | ||
85 | setTimeout(function(){ | 87 | setTimeout(function(){ |
86 | var splitaddressE = addressE.split(", "); | 88 | var splitaddressE = addressE.split(", "); |
87 | cityE = splitaddressE[4]; | 89 | cityE = splitaddressE[4]; |
... | @@ -100,11 +102,6 @@ app.post('/', async function(req,res){ | ... | @@ -100,11 +102,6 @@ app.post('/', async function(req,res){ |
100 | } | 102 | } |
101 | }); | 103 | }); |
102 | 104 | ||
103 | - | ||
104 | -app.listen(PORT, function(){ | ||
105 | - console.log('listen',PORT); | ||
106 | -}); | ||
107 | - | ||
108 | function trans(message, totrans){ | 105 | function trans(message, totrans){ |
109 | request.post( | 106 | request.post( |
110 | { | 107 | { |
... | @@ -129,14 +126,14 @@ function trans(message, totrans){ | ... | @@ -129,14 +126,14 @@ function trans(message, totrans){ |
129 | try { | 126 | try { |
130 | const option = { | 127 | const option = { |
131 | ca: fs.readFileSync('/etc/letsencrypt/live/' + domain +'/fullchain.pem'), | 128 | ca: fs.readFileSync('/etc/letsencrypt/live/' + domain +'/fullchain.pem'), |
132 | - key: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/'$ | 129 | + key: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/privkey.pem'), 'utf8').toString(), |
133 | - cert: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/$ | 130 | + cert: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/cert.pem'), 'utf8').toString(), |
134 | }; | 131 | }; |
135 | - | 132 | + |
136 | HTTPS.createServer(option, app).listen(sslport, () => { | 133 | HTTPS.createServer(option, app).listen(sslport, () => { |
137 | console.log(`[HTTPS] Server is started on port ${sslport}`); | 134 | console.log(`[HTTPS] Server is started on port ${sslport}`); |
138 | }); | 135 | }); |
139 | } catch (error) { | 136 | } catch (error) { |
140 | - console.log('[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않 $ | 137 | + console.log('[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.'); |
141 | console.log(error); | 138 | console.log(error); |
142 | } | 139 | } | ... | ... |
-
Please register or login to post a comment