Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
227 commits
Select commit Hold shift + click to select a range
394ccd4
lint: apply standard style
dougwilson Apr 22, 2019
04f0cf3
build: add travis CI for markdown linting
dougwilson Apr 22, 2019
6d695c4
lint: apply standard 12 formatting
dougwilson Apr 22, 2019
d8a4195
Update middleware readmes
dougwilson Apr 22, 2019
d1f7d49
build: make sure gh-pages is built on Travis CI
dougwilson Apr 22, 2019
eb0ac6b
Add codewithhugo.com Express posts
HugoDF Apr 16, 2019
4727554
Fix 404 error for edit on github
Tolsee Apr 6, 2019
a1a9506
Add Poet framework
edlongman Apr 24, 2019
2645df5
Add content to starter page for Turkish
mehmetalpsumer Apr 16, 2019
39ca405
Add search using docsearch
Apr 24, 2019
948dd32
Hide search box from mobile
dougwilson Apr 26, 2019
33a704d
Move search CSS into main stylesheet
dougwilson Apr 26, 2019
9185116
Update Korean translation
startergate Apr 10, 2019
898478e
translation update.
silverskyvicto May 11, 2019
6cc9fd7
Merge pull request #1042 from silverskyvicto/gh-pages
crandmck May 15, 2019
d61ae29
Update middleware readmes
dougwilson May 16, 2019
a5ca5b0
Update req.body to point to built-in middleware
dougwilson May 16, 2019
958e581
Add express.text documentation
dougwilson May 16, 2019
18dfac1
Add express.raw documentation
dougwilson May 16, 2019
4cfa31c
Update req.hostname for X-Forwarded-Host changes
dougwilson May 16, 2019
a2bf116
Add Express 4.17.0 changelog
dougwilson May 17, 2019
0269c48
Fix for search input overlapping
madflow May 22, 2019
d43b528
Fix the Turkish middleware pages
dougwilson May 25, 2019
ed4521e
Apply StandardJS style to translated docs
dougwilson May 26, 2019
134230b
Add Express 4.17.1 changelog
dougwilson May 26, 2019
faa6bb9
Apply StandardJS style to API docs
dougwilson May 27, 2019
10b6e53
copy 5x documentations files
RamirezAlex Apr 23, 2019
9cff646
Apply StandardJS fix to the documentation
RamirezAlex Jun 11, 2019
f389a73
Apply StandardJS style
RamirezAlex Jun 11, 2019
ea0779b
Update express-generator docs to use npx
pspi Feb 20, 2019
bec68ed
Merge pull request #1022 from pspi/patch-1
crandmck Jun 26, 2019
edaea4a
Merge pull request #1037 from RamirezAlex/5.x-docs
crandmck Jun 28, 2019
c343e6d
Initial cleanup of 5.x alpha doc
crandmck Jun 28, 2019
4142385
Update index.md
hyeonjae Jun 30, 2019
4acf359
Merge pull request #1050 from expressjs/5x-initial-cleanup
crandmck Jul 3, 2019
4f9d663
Add new book to the list.
nybblr Jul 9, 2019
e7ebaa0
Add standard en fallback to changelog
crandmck Jul 10, 2019
71c2131
Merge pull request #1055 from expressjs/fix-changelog-lang-fallback
crandmck Jul 10, 2019
57ece16
Merge pull request #1051 from hyeonjae/patch-1
crandmck Jul 10, 2019
a6fb466
Merge pull request #1054 from nybblr/patch-1
crandmck Jul 12, 2019
4b92c88
Broken Link Fixed
Imon-Haque Jul 25, 2019
ffefdc0
Update frameworks.md
Imon-Haque Jul 26, 2019
039f063
Fixes ISRG page link
bomoko Jul 28, 2019
b0f8dc3
Changes ISRG page link fix to point directly at www.abetterinternet.org
bomoko Jul 29, 2019
5ac914f
Changed signedCookie to signedCookies
amrendra007 Aug 1, 2019
f8bbf32
Add cls-rtracer into 3rd-party middleware list
puzpuzpuz Aug 2, 2019
c2da6ce
Update res.cookie for multiple key values
hematy61 Aug 17, 2019
fb9dad5
modify explanation
hematy61 Aug 20, 2019
085724a
fix formatting
hematy61 Aug 20, 2019
09455f4
Update healthcheck-graceful-shutdown.md
manjufy Aug 26, 2019
8617c54
Merge pull request #1058 from Imon-Haque/gh-pages
crandmck Sep 5, 2019
89e7fc1
Merge pull request #1059 from bomoko/patch-1
crandmck Sep 5, 2019
7518c7a
Merge pull request #1060 from amrendra007/patch-1
crandmck Sep 5, 2019
5e1a4c9
Merge pull request #1065 from manjufy/patch-1
crandmck Sep 5, 2019
4d82fa4
Merge pull request #1061 from puzpuzpuz/patch-1
crandmck Sep 5, 2019
efe692c
Merge pull request #1063 from hematy61/patch-1
crandmck Sep 5, 2019
aa50a24
Add Twing to the list of template engines
ericmorand Sep 18, 2019
2395330
Adding Expressive Tea to Frameworks
chrnx-dev Sep 24, 2019
cdb4b12
Update code samples in 5.x docs to use const
RamirezAlex Jul 19, 2019
848c652
Update hello-world.md
hyeonjae Sep 25, 2019
2eeb0cb
Update hello-world.md
hyeonjae Sep 26, 2019
4fab7e9
[UPDATE] ^4.16 Korean Changelog
startergate Oct 2, 2019
11d24cc
[UPDATE] 4.15.5 Korean Changelog
startergate Oct 2, 2019
bdc9f6d
Update 4x.md
startergate Oct 2, 2019
4b38a72
Update 4x.md
startergate Oct 5, 2019
997dbd3
Update 4x.md
startergate Oct 5, 2019
c54ed46
Update 4x.md
startergate Oct 5, 2019
65b9a61
updates to community page
wesleytodd Oct 12, 2019
c279190
Update Korean translation
jngcii Oct 28, 2019
f368c19
Update Korean translation(line break)
jngcii Oct 28, 2019
6ede5d0
Merge pull request #1068 from ericmorand/patch-1
crandmck Oct 28, 2019
7ee6c00
Merge pull request #1057 from RamirezAlex/5.x-const
crandmck Oct 28, 2019
16de424
Merge pull request #1070 from zerooneit/patch-1
crandmck Oct 28, 2019
e016fbe
Merge pull request #1072 from startergate/patch-1
crandmck Oct 28, 2019
0388d3f
Merge pull request #1081 from jngcii/typo
crandmck Oct 28, 2019
4665a52
[Fixed #1083] Removed left-over triple backtick
eyedean Oct 30, 2019
12788a7
[Fixed #1083] Bringing back the old text
eyedean Oct 30, 2019
bca0580
Update link to Squirrelly
bgub Nov 14, 2019
b49ab1b
Add express.raw and express.text to API doc
LoicPoullain Nov 27, 2019
322b036
Merge pull request #1071 from hyeonjae/patch-2
crandmck Dec 19, 2019
00db0dd
chore(docs): Fixed minor typo
anuraghazra Dec 25, 2019
84b0c79
Merge pull request #1091 from anuraghazra/patch-1
crandmck Jan 6, 2020
6474f58
Merge pull request #1087 from LoicPoullain/patch-1
crandmck Jan 6, 2020
8225868
Adds menu items for methods added in #1087 and alphabetizes
crandmck Jan 6, 2020
a067bda
remove link that points to inactive/malicious domain
jonchurch Jan 22, 2020
0c92769
Fixed res.sendFile docs in zh-tw, zh-cn, fr, & es #1098
yiyu0x Feb 15, 2020
a869de3
Fix a German translation issue #1105
moopat Feb 15, 2020
d36d6fe
Fix typo in Ko index.html #1106
No-YE Feb 15, 2020
cd7966f
Adding new projects is no longer supported #1108
anton-marchenko Feb 20, 2020
ddb0d1a
Fix req.secure section in 5.x documentation
Jan 12, 2020
7400546
Fix typo in frameworks.md
Jan 8, 2020
c2a3dcc
Update books-blogs.md
Ghvstcode Feb 28, 2020
327647e
Merge pull request #1086 from nebrelbug/patch-1
crandmck Mar 1, 2020
309ea1d
Merge pull request #1110 from Ghvstcode/patch-1
crandmck Mar 1, 2020
af222fd
Remove link to mean.js
bobtabor Mar 26, 2020
4a1e018
Remove language inviting folks to add their companies
jonchurch Mar 6, 2020
61d6fd6
Fix typo in installing.md
Mar 3, 2020
4f70099
Use Node.js 12 in CI
dougwilson Mar 26, 2020
3323c68
lint: apply standard 14 formatting
dougwilson Mar 26, 2020
926348e
Fix Elasticsearch casing
orhantoy Mar 2, 2020
aa87c9f
Remove defunct Google Tag Manager integration
realabbas Oct 7, 2019
776855b
Document other environment variables for debuging
zombieleet Jun 5, 2019
68ac70b
Update Exove company logo
Oct 22, 2019
c7e7055
Document how the default error handler writes the response
Mar 2, 2020
cf8f4d0
Update SQL server database integration example
joshgrib Jan 18, 2019
5f5ccc8
Fix index pages with CRLF line endings
dougwilson Apr 1, 2020
4b34e8f
Fix header includes with CRLF line endings
dougwilson Apr 1, 2020
7bc9163
Guide to overriding Express API
hacksparrow Jan 10, 2017
ce787c0
Rename "Books & Blogs" to "Additional learning"
dougwilson Apr 1, 2020
1b38348
Update references to expressjs repositories
dougwilson Apr 1, 2020
1fa296b
Add DEV community link to additional learning
belhassen07 Jul 16, 2018
d827830
Fix links to middleware from translations
dougwilson Apr 1, 2020
fa227c6
Update middleware readmes
dougwilson Apr 1, 2020
556d3de
Have example app emit a clickable link
sparksis Oct 11, 2019
cd6430e
Remove reference to deprecated hpkp
dougwilson Apr 1, 2020
cbdf829
Improve the req.fresh documentation
dougwilson Apr 1, 2020
2ecdca0
Remove req.param from 5.x API documentation
gireeshpunathil Apr 2, 2020
41256a9
Add http-terminator to graceful shutdown examples
gajus Jan 20, 2020
72a2a54
Add Eta to Template Engines list
bgub Apr 11, 2020
26aeec9
Add app.router documentation to 5.x API
gireeshpunathil Apr 2, 2020
0778156
Fix anchor link for docs in zh-TW
wildskyf Apr 7, 2020
c06e3f8
Fix example in next("router")
bemorr Apr 7, 2020
1e50c57
Clarify when req.query is always an empty object
gireeshpunathil Apr 2, 2020
da6856d
Remove app.param(callback) from 5.x API docs
HarshithaKP Apr 4, 2020
d13082d
Fix table style to block so as not to overflow into surrounding text
thomasgrz Apr 10, 2020
b7f7d9f
Add req.host property documentation to 5.x API
gireeshpunathil Apr 2, 2020
cfd9e4c
Add documention on Promise support in middleware for 5+
ryhinchey Apr 2, 2020
7d64d38
Document nexter('router') in API docs
HarshithaKP Apr 3, 2020
55b5733
Fix cookie-parser usage in middleware guide
zeayal May 3, 2020
70aa35a
Fix example result in the documentation of req.accepts
LoicPoullain May 1, 2020
648f3d5
Update the footers to point the OpenJS Foundation
mastermatt May 2, 2020
daeac13
BLM
tj Jun 2, 2020
4d21906
smooth over some css issues with blm banner
jonchurch Jun 2, 2020
9d9a1f7
Reduce navbar overflow and fix anchor positioning
jonchurch Jun 3, 2020
a80bd8a
Add require for express in middleware examples
AqibMukhtar May 30, 2020
50c07b8
Update middleware readmes
dougwilson Jun 3, 2020
0a1b96d
Fix the i18n notice box to account for banner
watilde Jun 4, 2020
12e0153
Translation update (#1169)
Felichz Jul 26, 2020
048b606
Update middleware readmes
dougwilson Jul 26, 2020
e9a347e
Change bold to angle brackets for systemd example
crandmck Jul 26, 2020
cd74801
Add get-contributing script for generating contribuing page
jonchurch Apr 6, 2020
94d4ce1
Add PowerShell DEBUG command example
Downes Jan 29, 2019
c5ca54a
Rephrase Russian top menu items to free-up space for search field
rodion-arr Jul 27, 2020
202b384
Add example graceful shutdown code
HarryEMartland Jul 21, 2020
1bd764b
Change hello world to not return value from arrow function
mjvandermeulen Jul 24, 2020
e4ef09d
Routing turkish translation (#1187)
ahmetomerv Aug 5, 2020
ad580d3
Added missing turkish translation part from english page of routing (…
ahmetomerv Aug 8, 2020
52a86b7
Updated to latest doc from english, added turkish translation (#1190)
ahmetomerv Aug 8, 2020
da57ad0
Add new Examples page (#1178)
rodion-arr Aug 8, 2020
4829d53
Using middleware page Turkish translation (#1188)
ahmetomerv Aug 8, 2020
ffe8aa4
Updated Debugging doc to latest, added Turkish translation (#1193)
ahmetomerv Aug 16, 2020
c115691
Added Overriding Express API doc file, translated to Turkish (#1194)
ahmetomerv Aug 16, 2020
6f218f0
synced to latest, added turkish translation (#1192)
ahmetomerv Aug 16, 2020
5069446
res.send documentation change (#1179)
schamberg97 Aug 16, 2020
d9779cf
Update Error Handling doc to latest, add Turkish translation (#1195)
ahmetomerv Aug 29, 2020
072d43c
Update writing-middleware doc to latest, add Turkish translation (#1196)
ahmetomerv Aug 29, 2020
a4745ec
Updated using-template-engines doc to latest, added Turkish translati…
ahmetomerv Aug 29, 2020
fcac2f2
docs: fix typo
adyjs Sep 10, 2020
7f91230
Update migrating-5.md (#1212)
ezehlivinus Oct 16, 2020
617e46e
Update link to express-handlebars
UziTech Oct 23, 2020
6b941bc
Fix typo in Korean Doc
tom9744 Jan 12, 2021
84cb541
Update FoalTS link and description
LoicPoullain Dec 18, 2020
ac6f88a
build: use GitHub Actions instead of Travis CI
dougwilson Jan 13, 2021
41ecfa8
Update Chinese translation documents
howiezhao Sep 19, 2020
5b4bf31
Add Sprightly template engine
obadakhalili Sep 17, 2020
b620242
Update Turkish performance best practices
ahmetomerv Aug 21, 2020
fc8a9de
Fix minor grammar mistake
astroud Feb 11, 2021
d11251d
Correct simple spelling mistakes for the "fr" translations
antoine-coulon Feb 8, 2021
ea653de
Update basic routing in French
fabienhinault Feb 5, 2021
114b390
Add express-vue template engine
JinsYin Feb 5, 2021
913a280
Use npm start in pm2 examples
dougwilson Jul 27, 2020
d86af85
Clarify req.originalUrl behaviour with query string in request
rodion-arr Dec 12, 2020
2fb23d5
Fix res.end to be res.end in middleware guide
gricey432 Jan 19, 2021
4844be3
Add LinuxStans blog
LinuxStans Feb 19, 2021
4aeb584
Fix docs for passing array of middleware to app.use()
rodion-arr Dec 5, 2020
6ec6e7e
Use Markdown-style code block in app.param docs
dougwilson Feb 19, 2021
2aebcd5
Use Markdown-style code blocks in app.use docs
dougwilson Feb 19, 2021
66a567d
build: eslint-plugin-markdown@^2.0.0
dougwilson Feb 19, 2021
97bd16c
Add ButterCMS blog
moluwole Feb 10, 2021
8e82322
Update description of xssFilter for helmet
cseas Mar 2, 2021
fdc33be
Fix mistakes in orverriding express Turkish guide
Jan 14, 2021
5784099
Update trust proxy guidence
dougwilson Mar 2, 2021
a7c598a
Remove deprecated nsp from security docs
dougwilson Mar 17, 2021
eba8585
Update nodesecurity.io references to npmjs.com
dougwilson Mar 17, 2021
fd0344c
Update middleware readmes
dougwilson Mar 17, 2021
aa3bdc7
Add cache buster on main stylesheet
dougwilson Apr 5, 2021
db55053
Add express-actuator to healthcheck examples
rcruzper Aug 17, 2020
ce27759
Remove deprecated template engines
bgub Apr 11, 2020
b4740ac
Show where server variable comes from in example
NSExceptional Apr 5, 2021
d5210e3
Update the description of LiquidJS
harttle Mar 11, 2021
b610ecb
Updated Turkish process managers page
Jan 14, 2021
1954eb4
Update the wording of req.ip/req.ips for trust proxy enabled
muxator Apr 13, 2020
c2b8ecf
Add and update Builder Book links
klyburke Apr 6, 2021
7ee54ee
Fix formatting in Korean middleware table
ChoSeyoung Apr 9, 2021
8f44e00
Remove direct reference to mime.lookup() as package changed
dougwilson Apr 18, 2021
c93a2a7
Add Wormhole to list of companies using Express
feross May 4, 2021
c23416d
build: eslint-plugin-markdown@^2.1.0
dougwilson May 15, 2021
452e959
build: eslint@^7.26.0
dougwilson May 15, 2021
d49bcad
build: eslint-plugin-import@^2.23.1
dougwilson May 15, 2021
5ae5d7b
build: fix eslint globbing behavior
dougwilson May 15, 2021
d473f2b
Add colon to end of statement in generator page
Abhishek01039 May 15, 2021
76470b2
Update Neo4j connection example to neo4j-driver
adam-cowley May 14, 2021
63483b2
Fix typo in Turkish middleware guide
AliAnilKocak May 31, 2021
a770565
Update middleware readmes
dougwilson May 31, 2021
2d75053
Fix typo in overriding guide
rayjasson98 Jun 28, 2021
2fd79b7
Fix try...catch style
lukeingalls Jun 19, 2021
2ed9a7f
Remove unmaintained template engines
iamarpitpatidar May 27, 2021
067e352
Add require('path') to starter/static-files path example
arye-eidelman Jun 11, 2021
0022c00
build: eslint@^7.29.0
dougwilson Jul 1, 2021
3f6dcc6
build: eslint-plugin-import@^2.23.4
dougwilson Jul 1, 2021
1cd155d
build: eslint-plugin-markdown@^2.2.0
dougwilson Jul 1, 2021
d0b4ac9
build: eslint-plugin-node@^11.1.0
dougwilson Jul 1, 2021
8d887d6
build: eslint-plugin-standard@^4.1.0
dougwilson Jul 1, 2021
c70ee23
Remove misleading req.query examples
dougwilson Aug 11, 2021
ea3ef93
build: eslint@^7.32.0
dougwilson Aug 11, 2021
f0cdc7d
Fix typo in Korean routing guide
Unuuuuu Aug 5, 2021
c3e98da
Update Turkish security best practices translation
ahmetomerv Apr 15, 2021
754b613
Remove misleading examples in res.sendStatus
dougwilson Aug 11, 2021
b2165c2
Update performance best practice JS examples
dougwilson Aug 11, 2021
df02492
Update middleware readmes
dougwilson Aug 11, 2021
abeddca
Improve Chinese translation in routing guide
ieeeeeepn Sep 4, 2021
9dbba79
build: Node.js@16
dougwilson Sep 5, 2021
f0dc3b0
build: eslint-plugin-import@^2.24.2
dougwilson Sep 5, 2021
464d0c6
build: eslint-plugin-promise@^4.3.1
dougwilson Sep 5, 2021
5b2538f
Fix typo in Chinese routing guide
ieeeeeepn Sep 6, 2021
3ade311
Update EJS repo link
rjnay1984 Sep 8, 2021
57d0dc4
Fix res.type() documentation to include correct reference to mime lookup
jonathansamines Sep 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Korean translation
  • Loading branch information
startergate authored and dougwilson committed Apr 28, 2019
commit 91851160f224481a4a9617055ffc3622bbc8e91e
9 changes: 0 additions & 9 deletions ko/3x/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,10 @@ lang: ko

<h1>3.x API</h1>

<a id='express' class='h2'></a>
{% include api/en/3x/express.md %}

<a id='application' class='h2'></a>
{% include api/en/3x/app.md %}

<a id='request' class='h2'></a>
{% include api/en/3x/req.md %}

<a id='response' class='h2'></a>
{% include api/en/3x/res.md %}

<a id='middleware' class='h2'></a>
{% include api/en/3x/middleware.md %}

</div>
9 changes: 0 additions & 9 deletions ko/4x/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ lang: ko

<h1>4.x API</h1>

<a id='express' class='h2'></a>
{% include api/en/4x/express.md %}

<a id='app' class='h2'></a>
{% include api/en/4x/app.md %}

<a id='req' class='h2'></a>
{% include api/en/4x/req.md %}

<a id='res' class='h2'></a>
{% include api/en/4x/res.md %}

<a id='router' class='h2'></a>
{% include api/en/4x/router.md %}

</div>
205 changes: 115 additions & 90 deletions ko/advanced/best-practice-performance.md

Large diffs are not rendered by default.

171 changes: 89 additions & 82 deletions ko/advanced/best-practice-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,34 @@ lang: ko

## 개요

*"프로덕션(production)"*이라는 용어는 소프트웨어 라이프사이클 중 애플리케이션 또는 API가 최종 사용자 또는 소비자에게 정식으로 제공되는 단계를 말합니다. 이와 반대로 *"개발(development)"* 단계에서는 아직 코드가 활발하게 작성 및 테스트되며 애플리케이션은 외부 액세스에 개방되지 않습니다. 이에 대응하는 시스템 환경은 각각 *프로덕션* 환경 및 *개발* 환경이라고 부릅니다.
__"프로덕션 (production)"__ 이라는 용어는 소프트웨어 라이프사이클 중 애플리케이션 또는 API가 최종 사용자 또는 소비자에게 정식으로 제공되는 단계를 말합니다. 이와 반대로 *"개발(development)"* 단계에서는 아직 코드가 활발하게 작성 및 테스트되며 애플리케이션은 외부 액세스에 개방되지 않습니다. 이에 대응하는 시스템 환경은 각각 *프로덕션* 환경 및 *개발* 환경이라고 부릅니다.

개발 환경 및 프로덕션 환경은 일반적으로 서로 다르게 설정되며 두 환경의 요구사항은 크게 다릅니다. 개발 환경에서는 좋은 것일지라도 프로덕션 환경에서는 허용되지 않을 수도 있습니다. 예를 들면, 개발 환경에서는 디버깅을 위해 상세한 오류 로깅이 선호될 수 있지만, 이러한 행동은 프로덕션 환경에서 보안 우려사항이 될 수 있습니다. 그리고 개발 환경에서는 확장성, 신뢰성 및 성능에 대해 걱정할 필요가 없지만, 이러한 요인들은 프로덕션 환경에서 매우 중요해집니다.

{% include note.html content="Express의 보안 취약점을 발견하신것 같다면,
[Security Policies and Procedures](/en/resources/contributing.html#security-policies-and-procedures)를 따라주십시오.
" %}

이 문서에서는 프로덕션 환경에 배치된 Express 애플리케이션을 위한 몇 가지 보안 우수 사례에 대해 논의합니다.

## 더 이상 사용되지 않거나 취약성이 있는 버전의 Express를 사용하지 마십시오
- [더 이상 사용되지 않거나 취약성이 있는 버전의 Express 사용 중지](#dont-use-deprecated-or-vulnerable-versions-of-express)
- [TLS 사용](#use-tls)
- [Helmet 사용](#use-helmet)
- [쿠키를 안전하게 사용](#use-cookies-securely)
- [인증 체계에 대한 브루스 포트 공격 방지](#prevent-brute-force-attacks-against-authorization)
- [종속 항목이 안전한지 확인](#ensure-your-dependencies-are-secure)
- [그 외의 알려져 있는 취약점 회피](#avoid-other-known-vulnerabilities)
- [추가적인 고려사항](#additional-considerations)

<a name="dont-use-deprecated-or-vulnerable-versions-of-express"></a>
## 더 이상 사용되지 않거나 취약성이 있는 버전의 Express를 사용 중지

Express 2.x 및 3.x에 대한 유지보수는 더 이상 이루어지지 않습니다. 이러한 버전에서의 보안 및 성능 문제는 수정되지 않습니다. 이러한 버전은 사용하지 마십시오! 아직 버전 4로 이전하지 않은 경우에는 [마이그레이션 안내서](/{{ page.lang }}/guide/migrating-4.html)를 따르십시오.

또한 [보안 업데이트 페이지](/{{ page.lang }}/advanced/security-updates.html)의 목록에 포함된 취약성 있는 Express 버전을 사용하고 있지 않은지 확인하십시오. 취약성 있는 Express 버전을 사용하고 있는 경우에는 안정적인 릴리스 중 하나로 업데이트해야 하며, 가능하면 최신 버전으로 업데이트하는 것이 좋습니다.


<a name="use-tls"></a>
## TLS 사용

앱이 민감한 데이터를 다루거나 전송하는 경우에는 [전송 계층 보안](https://en.wikipedia.org/wiki/Transport_Layer_Security)(TLS)을 사용하여 연결 및 데이터를 보호하십시오. 이 기술은 데이터를 클라이언트로부터 서버로 전송하기 전에 데이터를 암호화하며, 따라서 몇 가지 일반적인(그리고 쉬운) 해킹을 방지합니다. Ajax 및 POST 요청은 브라우저에서 분명하게 보이지 않고 "숨겨진" 것처럼 보일 수도 있지만, 이러한 요청의 트래픽은 [패킷 가로채기](https://en.wikipedia.org/wiki/Packet_analyzer) 및 [중간자 공격](https://en.wikipedia.org/wiki/Man-in-the-middle_attack)에 취약합니다.
Expand All @@ -29,6 +45,7 @@ Express 2.x 및 3.x에 대한 유지보수는 더 이상 이루어지지 않습

또한 무료 TLS 인증서를 얻기 위한 편리한 도구 중 하나는 [Internet Security Research Group(ISRG)](https://letsencrypt.org/isrg/)이 제공하는 무료의 자동 개방형 인증 기관(CA)인 [Let's Encrypt](https://letsencrypt.org/about/)입니다.

<a name="use-helmet"></a>
## Helmet 사용

[Helmet](https://www.npmjs.com/package/helmet)을 이용하면 HTTP 헤더를 적절히 설정하여 몇 가지 잘 알려진 웹 취약성으로부터 앱을 보호할 수 있습니다.
Expand All @@ -47,37 +64,37 @@ Express 2.x 및 3.x에 대한 유지보수는 더 이상 이루어지지 않습

다른 모든 모듈처럼 Helmet은 다음과 같이 설치할 수 있습니다.

<pre>
<code class="language-sh" translate="no">
```sh
$ npm install --save helmet
</code>
</pre>
```

이후 코드에서 Helmet을 사용하는 방법은 다음과 같습니다.

<pre>
<code class="language-javascript" translate="no">
...
var helmet = require('helmet');
app.use(helmet());
...
</code>
</pre>
```js
// ...

var helmet = require('helmet')
app.use(helmet())

// ...
```

### 적어도 X-Powered-By 헤더는 사용하지 않도록 설정

Helmet의 사용을 원치 않는 경우에는 적어도 `X-Powered-By` 헤더를 사용하지 마십시오. 공격자는 이 헤더(기본적으로 사용하도록 설정되어 있음)를 이용해 Express를 실행하는 앱을 발견한 후 특정한 대상에 대한 공격을 실행할 수 있습니다.

따라서 우수 사례는 다음과 같이 `app.disable()` 메소드를 이용해 이 헤더를 끄는 것입니다.

<pre>
<code class="language-javascript" translate="no">
app.disable('x-powered-by');
</code>
</pre>

```js
app.disable('x-powered-by')
```

`helmet.js`를 사용하는 경우에는 사용자를 대신하여 `helmet.js`가 위의 작업을 실행합니다.

{% include note.html content="`X-Powered-By header`를 비활성화하는 행위는 고수준의 공격자가 앱이 Express를 사용하고 있는지 확인하는 걸 막을 수 없습니다. 일반적인 취약점은 막을지 모르지만, 앱이 Express를 사용하고 있는지 알아내는 다른 방법은 많이 있습니다. "%}

<a name="use-cookies-securely"></a>
## 쿠키를 안전하게 사용

쿠키로 인해 앱이 악용에 노출되지 않도록 하기 위해 기본 세션 쿠키 이름을 사용하지 말고 쿠키 보안 옵션을 적절히 설정하십시오.
Expand All @@ -97,17 +114,14 @@ app.disable('x-powered-by');

이러한 문제점을 피하려면 일반적인 쿠키 이름을 사용하십시오. 예를 들면 [express-session](https://www.npmjs.com/package/express-session) 미들웨어를 이용해 다음과 같이 하십시오.

<pre>
<code class="language-javascript" translate="no">
var session = require('express-session');
```js
var session = require('express-session')
app.set('trust proxy', 1) // trust first proxy
app.use( session({
secret : 's3Cur3',
name : 'sessionId',
})
);
</code>
</pre>
app.use(session({
secret: 's3Cur3',
name: 'sessionId'
}))
```

### 쿠키 보안 옵션 설정

Expand All @@ -121,81 +135,74 @@ app.use( session({

다음에는 [cookie-session](https://www.npmjs.com/package/cookie-session) 미들웨어를 사용한 예가 표시되어 있습니다.

<pre>
<code class="language-javascript" translate="no">
var session = require('cookie-session');
var express = require('express');
var app = express();
```js
var session = require('cookie-session')
var express = require('express')
var app = express()

var expiryDate = new Date( Date.now() + 60 * 60 * 1000 ); // 1 hour
var expiryDate = new Date(Date.now() + 60 * 60 * 1000) // 1 hour
app.use(session({
name: 'session',
keys: ['key1', 'key2'],
cookie: { secure: true,
httpOnly: true,
domain: 'example.com',
path: 'foo/bar',
expires: expiryDate
}
})
);
</code>
</pre>

## 종속 항목이 안전한지 확인하십시오
cookie: {
secure: true,
httpOnly: true,
domain: 'example.com',
path: 'foo/bar',
expires: expiryDate
}
}))
```

<a name="ensure-your-dependencies-are-secure"></a>
## 종속 항목이 안전한지 확인

npm을 이용해 애플리케이션의 종속 항목을 관리하는 것은 강력하면서도 편리합니다. 그러나 사용 중인 패키지에는 애플리케이션에 영향을 미칠 수 있는 치명적인 보안 취약성이 포함되어 있을 수도 있습니다. 앱의 보안성은 종속 항목 내의 "가장 약한 링크"의 보안성에 따라 결정됩니다.

사용 중인 써드파티 패키지의 보안성을 보장하려면 [nsp](https://www.npmjs.com/package/nsp)와 [requireSafe](https://requiresafe.com/) 중 어느 하나 또는 둘 모두를 사용하십시오. 이 두 도구의 기능은 대체로 동일합니다.
npm@6부터 npm은 자동으로 모든 설치 요청을 검사합니다. 또한 `npm audit`을 이용해 여러분의 의존성 트리를 검사할 수 있습니다.

[nsp](https://www.npmjs.com/package/nsp)는 [Node Security Project](https://nodesecurity.io/) 취약성 데이터베이스를 확인하여, 알려진 취약성이 있는 패키지가 애플리케이션에 사용되었는지 파악하는 명령행 도구입니다. nsp를 설치하려면 다음과 같이 하십시오.
```sh
$ npm audit
```

<pre>
<code class="language-sh" translate="no">
$ npm i nsp -g
</code>
</pre>
더 강한 보안을 원한다면, [Snyk](https://snyk.io/)를 사용하십시오.

유효성 검증을 위한 `npm-shrinkwrap.json` 파일을 [nodesecurity.io](https://nodesecurity.io/)에 제출하려면 다음과 같은 명령을 사용하십시오.
Snyk offers both a [command-line tool](https://www.npmjs.com/package/snyk) and a [Github 통합](https://snyk.io/docs/github) that checks your application against [Snyk's open source vulnerability database](https://snyk.io/vuln/) for any known vulnerabilities in your dependencies. Install the CLI as follows:
Sync는 [커맨드라인 도구](https://www.npmjs.com/package/snyk)와 [Snyk's open source vulnerability database](https://snyk.io/vuln/)에 있는 여러분의 의존성들의 알려진 취약성에 대한 검사를 실행하는 [Github integration](https://snyk.io/docs/github)을 제공합니다. 아래 커맨드로 설치합니다.

<pre>
<code class="language-sh" translate="no">
$ nsp audit-shrinkwrap
</code>
</pre>
```sh
$ npm install -g snyk
$ cd your-app
```

유효성 검증을 위한 `package.json` 파일을 [nodesecurity.io](https://nodesecurity.io/)에 제출하려면 다음과 같은 명령을 사용하십시오.
아래 명령으로 애플리케이션의 취약점을 검사합니다.

<pre>
<code class="language-sh" translate="no">
$ nsp audit-package
</code>
</pre>
```sh
$ snyk test
```

[requireSafe](https://requiresafe.com/)를 이용해 Node 모듈에 대한 감사를 실행하는 방법은 다음과 같습니다.
Use this command to open a wizard that walks you through the process of applying updates or patches to fix the vulnerabilities that were found:
아래 명령으로 찾은 취약점을 고치는 패치나 업데이트를 받는 설치 마법사를 실행합니다.

<pre>
<code class="language-sh" translate="no">
$ npm install -g requiresafe
$ cd your-app
$ requiresafe check
</code>
</pre>
```sh
$ snyk wizard
```

<a name="avoid-other-known-vulnerabilities"></a>
## 그 외의 알려져 있는 취약점 회피

Express에, 또는 앱에 사용되는 다른 모듈에 영향을 미칠 수 있는 [Node Security Project](https://nodesecurity.io/advisories)의 보안 권고문에 항상 주의를 기울이십시오. 일반적으로 Node Security Project는 Node의 보안과 관련된 지식 및 도구에 대한 훌륭한 자원입니다.

마지막으로, 다른 모든 웹 앱과 마찬가지로 Express 앱은 다양한 웹 기반 공격에 취약할 수 있습니다. 알려져 있는 [웹 취약성](https://www.owasp.org/index.php/Top_10_2013-Top_10)을 숙지한 후 이러한 취약성을 피하기 위한 예방 조치를 취하십시오.

<a name="additional-considerations"></a>
## 추가적인 고려사항

유용한 [Node.js Security Checklist](https://blog.risingstack.com/node-js-security-checklist/)에서 발췌한 몇 가지 추가적인 권장사항은 다음과 같습니다. 아래의 권장사항에 대한 모든 상세 정보를 확인하려면 해당 블로그 게시물을 참조하십시오.
유용한 [Node.js Security Checklist](https://blog.risingstack.com/node-js-security-checklist/)에서 발췌한 몇 가지 추가적인 권장사항은 다음과 같습니다. 아래의 권장사항에 대한 모든 상세 정보를 확인하려면 해당 블로그 게시물을 참조하십시오.

* 속도 제한(rate-limiting)을 구현하여 인증에 대한 무차별 대입 공격을 방지하십시오. 이를 실행하는 한 가지 방법은 [StrongLoop API Gateway](https://strongloop.com/node-js/api-gateway/)를 이용하여 속도 제한 정책을 적용하는 것입니다. 대안적으로, [express-limiter](https://www.npmjs.com/package/express-limiter)와 같은 미들웨어를 사용할 수 있지만, 그러한 경우에는 코드를 어느 정도 수정해야 합니다.
* [csurf](https://www.npmjs.com/package/csurf) 미들웨어를 이용하여 교차 사이트 요청 위조(CSRF)로부터 보호하십시오.
* 항상 사용자 입력을 필터링하고 사용자 입력에서 민감한 데이터를 제거하여 XSS(Cross-site scripting) 및 명령 인젝션 공격으로부터 보호하십시오.
* 매개변수화된 조회 또는 준비된 명령문을 이용하여 SQL 인젝션 공격으로부터 방어하십시오.
* 오픈 소스 방식의 [sqlmap](http://sqlmap.org/) 도구를 이용하여 앱 내의 SQL 인젝션 취약성을 발견하십시오.
* [nmap](https://nmap.org/) 및 [sslyze](https://github.com/nabla-c0d3/sslyze) 도구를 이용하여 SSL 암호, 키 및 재협상의 구성, 그리고 인증서의 유효성을 테스트하십시오.
* [safe-regex](https://www.npmjs.com/package/safe-regex)를 이용하여 정규식이 [정규식 서비스 거부](https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS) 공격을 쉽게 받지 않도록 하십시오.

## 그 외의 알려져 있는 취약성을 피하십시오

Express에, 또는 앱에 사용되는 다른 모듈에 영향을 미칠 수 있는 [Node Security Project](https://nodesecurity.io/advisories)의 보안 권고문에 항상 주의를 기울이십시오. 일반적으로 Node Security Project는 Node의 보안과 관련된 지식 및 도구에 대한 훌륭한 자원입니다.

마지막으로, 다른 모든 웹 앱과 마찬가지로 Express 앱은 다양한 웹 기반 공격에 취약할 수 있습니다. 알려져 있는 [웹 취약성](https://www.owasp.org/index.php/Top_10_2013-Top_10)을 숙지한 후 이러한 취약성을 피하기 위한 예방 조치를 취하십시오.
48 changes: 21 additions & 27 deletions ko/advanced/developing-template-engines.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,42 @@
---
layout: page
title: Express용 템플리트 엔진 개발
title: Express용 템플릿 엔진 개발
menu: advanced
lang: ko
---

# Express용 템플리트 엔진 개발
# Express용 템플릿 엔진 개발

`app.engine(ext, callback)` 메소드를 사용하면 자신만의 템플리트 엔진을 작성할 수 있습니다. `ext`는 파일 확장자를 나타내며, `callback`은 파일의 위치, 옵션 오브젝트 및 콜백 함수 등의 항목을 매개변수로 수락하는 템플리트 엔진 함수입니다.
`app.engine(ext, callback)` 메소드를 사용하면 자신만의 템플릿 엔진을 작성할 수 있습니다. `ext`는 파일 확장자를 나타내며, `callback`은 파일의 위치, 옵션 오브젝트 및 콜백 함수 등의 항목을 매개변수로 수락하는 템플릿 엔진 함수입니다.

다음의 코드는 `.ntl` 파일을 렌더링하기 위한 매우 간단한 템플리트 엔진을 구현하는 예입니다.
다음의 코드는 `.ntl` 파일을 렌더링하기 위한 매우 간단한 템플릿 엔진을 구현하는 예입니다.

<pre>
<code class="language-javascript" translate="no">
var fs = require('fs'); // this engine requires the fs module
```js
var fs = require('fs') // this engine requires the fs module
app.engine('ntl', function (filePath, options, callback) { // define the template engine
fs.readFile(filePath, function (err, content) {
if (err) return callback(new Error(err));
if (err) return callback(err)
// this is an extremely simple template engine
var rendered = content.toString().replace('#title#', '<title>'+ options.title +'</title>')
.replace('#message#', '<h1>'+ options.message +'</h1>');
return callback(null, rendered);
});
});
app.set('views', './views'); // specify the views directory
app.set('view engine', 'ntl'); // register the template engine
</code>
</pre>
var rendered = content.toString().replace('#title#', '<title>' + options.title + '</title>')
.replace('#message#', '<h1>' + options.message + '</h1>')
return callback(null, rendered)
})
})
app.set('views', './views') // specify the views directory
app.set('view engine', 'ntl') // register the template engine
```

앱은 이제 `.ntl` 파일을 렌더링할 수 있습니다. 다음의 내용이 입력된 `index.ntl`이라는 이름의 파일을 `views` 디렉토리에 작성하십시오.

<pre>
<code class="language-javascript" translate="no">
```text
#title#
#message#
</code>
</pre>
```
이후 앱에 다음과 같은 라우트를 작성하십시오.

<pre>
<code class="language-javascript" translate="no">
```js
app.get('/', function (req, res) {
res.render('index', { title: 'Hey', message: 'Hello there!'});
});
</code>
</pre>
res.render('index', { title: 'Hey', message: 'Hello there!' })
})
```
홈 페이지에 대한 요청을 실행할 때 `index.ntl`은 HTML로 렌더링됩니다.
Loading