diff --git a/_includes/header/header-de.html b/_includes/header/header-de.html index 94c07c3ad6..4ef32c5ef0 100644 --- a/_includes/header/header-de.html +++ b/_includes/header/header-de.html @@ -97,8 +97,7 @@ diff --git a/_includes/header/header-en.html b/_includes/header/header-en.html index bfffcbac9f..a8b93f3477 100644 --- a/_includes/header/header-en.html +++ b/_includes/header/header-en.html @@ -105,9 +105,7 @@ diff --git a/_includes/header/header-fr.html b/_includes/header/header-fr.html index 3de9257430..876da877b9 100644 --- a/_includes/header/header-fr.html +++ b/_includes/header/header-fr.html @@ -98,8 +98,6 @@ diff --git a/_includes/header/header-it.html b/_includes/header/header-it.html index e825762fad..fa35ba53d6 100644 --- a/_includes/header/header-it.html +++ b/_includes/header/header-it.html @@ -95,8 +95,6 @@ diff --git a/_includes/header/header-ja.html b/_includes/header/header-ja.html index 23562f410f..4fbb42f0dd 100644 --- a/_includes/header/header-ja.html +++ b/_includes/header/header-ja.html @@ -98,8 +98,6 @@ diff --git a/_includes/header/header-ko.html b/_includes/header/header-ko.html index 286f359cdd..671c4841d4 100644 --- a/_includes/header/header-ko.html +++ b/_includes/header/header-ko.html @@ -98,8 +98,6 @@ diff --git a/_includes/header/header-pt-br.html b/_includes/header/header-pt-br.html index 1b23a2c188..a97168049b 100644 --- a/_includes/header/header-pt-br.html +++ b/_includes/header/header-pt-br.html @@ -98,8 +98,6 @@ diff --git a/_includes/header/header-ru.html b/_includes/header/header-ru.html index 4d29c40bd8..0f83a2bb1c 100644 --- a/_includes/header/header-ru.html +++ b/_includes/header/header-ru.html @@ -98,8 +98,6 @@ diff --git a/_includes/header/header-sk.html b/_includes/header/header-sk.html index a5aec987b3..459b446b5c 100644 --- a/_includes/header/header-sk.html +++ b/_includes/header/header-sk.html @@ -98,8 +98,6 @@ diff --git a/_includes/header/header-th.html b/_includes/header/header-th.html index 8e9a00f145..9f998b2352 100644 --- a/_includes/header/header-th.html +++ b/_includes/header/header-th.html @@ -98,8 +98,6 @@ diff --git a/_includes/header/header-zh-cn.html b/_includes/header/header-zh-cn.html index 283d41ade9..20bbde6baa 100644 --- a/_includes/header/header-zh-cn.html +++ b/_includes/header/header-zh-cn.html @@ -98,8 +98,6 @@ diff --git a/_includes/header/header-zh-tw.html b/_includes/header/header-zh-tw.html index 91c061292c..f252249a6b 100644 --- a/_includes/header/header-zh-tw.html +++ b/_includes/header/header-zh-tw.html @@ -98,15 +98,12 @@ @@ -121,9 +118,6 @@
  • 社群
  • -
  • 額外學習 -
  • - diff --git a/de/advanced/best-practice-performance.md b/de/advanced/best-practice-performance.md index b34148359b..ab975eb38c 100755 --- a/de/advanced/best-practice-performance.md +++ b/de/advanced/best-practice-performance.md @@ -242,7 +242,7 @@ Die gängigsten Prozessmanager für Node sind: * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -Einen Vergleich der Features und Funktionen dieser Prozessmanager finden Sie hier: [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Eine ausführliche Einführung in diese drei Prozessmanager finden Sie hier: [Prozessmanager für Express-Anwendungen](/{{ page.lang }}/advanced/pm.html). +Einen Vergleich der Features und Funktionen dieser Prozessmanager finden Sie hier: [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Die Verwendung eines dieser Prozessmanager reicht aus, um Ihre Anwendung betriebsbereit zu halten, selbst wenn sie hin und wieder abstürzt. diff --git a/de/advanced/pm.md b/de/advanced/pm.md deleted file mode 100755 index 0aecc367d1..0000000000 --- a/de/advanced/pm.md +++ /dev/null @@ -1,238 +0,0 @@ ---- -layout: page -title: Prozessmanager für Express-Anwendungen -menu: advanced -lang: de ---- - -# Prozessmanager für Express-Anwendungen - -Wenn Sie Express-Anwendungen für Produktionsumgebungen ausführen, ist der Einsatz eines *Prozessmanagers* hilfreich, um folgende Aufgaben (Tasks) auszuführen: - -- Automatischer Neustart der Anwendung nach einem Absturz -- Einblicke in die Laufzeitleistung und die Ressourcennutzung -- Dynamische Änderung der Einstellungen zur Verbesserung des Leistungsverhaltens -- Steuerung des Clustering - -Ein Prozessmanager ist vergleichbar mit einem Anwendungsserver: er ist ein "Container" für Anwendungen, der die Bereitstellung erleichtert, eine hohe Verfügbarkeit sicherstellt und die Verwaltung der Anwendung zur Laufzeit ermöglicht. - -Die gängigsten Prozessmanager für Express- und andere Node.js-Anwendungen sind: - -- [StrongLoop Process Manager](#sl) -- [PM2](#pm2) -- [Forever](#forever) - - -Der Einsatz eines dieser drei Tools kann sehr hilfreich sein. StrongLoop Process Manager ist jedoch das einzige Tool, dass eine umfassende Laufzeit- und Bereitstellungslösung bietet, die den gesamten Node.js-Anwendungslebenszyklus abdeckt. Für jeden Schritt vor und nach der Produktion steht über eine einheitliche Schnittstelle ein Tool zur Verfügung. - -Nachfolgend finden Sie einen Kurzbeschreibung zu jedem dieser Tools. -Einen ausführlichen Vergleich der Tools finden Sie unter [http://strong-pm.io/compare/](http://strong-pm.io/compare/). - -## StrongLoop Process Manager - -StrongLoop Process Manager (StrongLoop PM) ist ein Prozessmanager für Node.js-Anwendungen in Produktionsumgebungen. StrongLoop PM verfügt über integrierte Funktionen für Lastverteilung, Überwachung und Bereitstellung auf mehreren Hosts sowie eine grafische Konsole. Mit StrongLoop PM lassen sich die folgenden Aufgaben (Tasks) ausführen: - -- Erstellen, Packen und Bereitstellen Ihrer Node.js-Anwendung auf einem lokalen oder fernen System -- Anzeige von CPU-Profilen und Heapspeichermomentaufnahmen (Heap-Snapshots) zur Optimierung der Leistung und Diagnose von Speicherlecks -- Herstellen der dauerhaften Betriebsbereitschaft von Prozessen und Clustern -- Anzeige von Leistungsmessdaten für Ihre Anwendung -- Einfache Verwaltung von Bereitstellungen auf mehreren Hosts inkl. Nginx-Integration -- Vereinheitlichung mehrerer StrongLoop PMs auf einer über Arc verwalteten verteilten Microservices-Laufzeitumgebung - -StrongLoop PM kann über ein leistungsfähiges Befehlszeilen-Schnittstellentool namens `slc` oder das grafisch orientierte Tool Arc genutzt werden. Arc ist ein Open-Source-Tool, das von StrongLoop kompetent unterstützt wird. - -Weitere Informationen siehe [http://strong-pm.io/](http://strong-pm.io/). - -Vollständige Dokumentation - -- [Node-Anwendungen im Betrieb (in der StrongLoop-Dokumentation)](http://docs.strongloop.com/display/SLC) -- [StrongLoop Process Manager verwenden](http://docs.strongloop.com/display/SLC/Using+Process+Manager) - -### Installation - -```console -$ [sudo] npm install -g strongloop -``` - -### Grundlegende Verwendung - -```console -$ cd my-app -$ slc start -``` - -Anzeigen des Status von Process Manager und allen bereitgestellten Anwendungen: - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -Auflisten aller verwalteten Anwendungen (Services): - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -Stoppen einer Anwendung: - -```console -$ slc ctl stop my-app -``` - -Neustart einer Anwendung: - -```console -$ slc ctl restart my-app -``` - -Sie können auch einen "Soft Restart" durchführen, damit die Verarbeitungsprozesse eine Karenzzeit zum Schließen bestehender Verbindungen erhalten. Dann kann die aktuelle Anwendung neu gestartet werden: - -```console -$ slc ctl soft-restart my-app -``` - -Entfernen einer Anwendung aus dem Verwaltungsprozess: - -```console -$ slc ctl remove my-app -``` - -## PM2 - -PM2 ist ein Prozessmanager für Node.js-Anwendungen in Produktionsumgebungen, der über eine integrierte Lastausgleichsfunktion verfügt. Mit PM2 lässt sich die dauerhafte Betriebsbereitschaft von Anwendungen sicherstellen. So können die Anwendungen ohne Ausfallzeiten erneut geladen werden, wodurch die Ausführung allgemeiner Systemverwaltungsaufgaben erleichtert wird. Über PM2 können auch Protokollierung, Überwachung und Clustering von Anwendungen vorgenommen werden. - -Weitere Informationen siehe [https://github.com/Unitech/pm2](https://github.com/Unitech/pm2). - -### Installation - -```console -$ [sudo] npm install pm2 -g -``` - -### Grundlegende Verwendung - -Wenn Sie eine Anwendung mit dem Befehl `pm2` starten, müssen Sie den Pfad zur Anwendung angeben. Wenn Sie eine Anwendung jedoch stoppen, neu starten oder löschen, können Sie auch nur den Namen oder die ID der Anwendung angeben. - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use the `pm2 show ` command to get more details about an app. -``` - -Wenn Sie eine Anwendung mit dem Befehl `pm2` starten, wird die Anwendung sofort in den Hintergrund gestellt. Sie können diese im Hintergrund laufende Anwendung über die Befehlszeile mit verschiedenen `pm2`-Befehlen steuern. - -nach dem Starten einer Anwendung mit dem Befehl `pm2` wird diese in der PM2-Prozessliste mit einer ID registriert. Sie können also Anwendungen mit demselben Namen aus verschiedenen Verzeichnissen auf dem System über deren ID verwalten. - -Beachten Sie Folgendes: Wenn mehrere Anwendungen mit demselben Namen ausgeführt werden, gelten die `pm2`-Befehle für alle Anwendungen. Verwenden Sie daher für das Verwalten einzelner Anwendungen IDs anstelle von Namen. - -Erstellen einer Liste aller aktiven Prozesse: - -```console -$ pm2 list -``` - -Stoppen einer Anwendung: - -```console -$ pm2 stop 0 -``` - -Neustart einer Anwendung: - -```console -$ pm2 restart 0 -``` - -Anzeige detaillierter Informationen zu einer Anwendung: - -```console -$ pm2 show 0 -``` - -Entfernen einer Anwendung aus dem PM2-Register: - -```console -$ pm2 delete 0 -``` - - -## Forever - -Forever ist ein einfaches Befehlszeilen-Schnittstellentool, mit dem sichergestellt wird, dass ein Script kontinuierlich ausgeführt wird. Die einfache Benutzerschnittstelle von Forever eignet sich ideal für einfachere Bereitstellungen von Node.js-Anwendungen und Scripts. - -Weitere Informationen siehe [https://github.com/foreverjs/forever](https://github.com/foreverjs/forever). - -### Installation - -```console -$ [sudo] npm install forever -g -``` - -### Grundlegende Verwendung - -Verwenden Sie zum Starten eines Scripts den Befehl `forever start` und geben Sie den Pfad zum Script an: - -```console -$ forever start script.js -``` - -Dieser Befehl führt das Script im Dämonmodus (im Hintergrund) aus. - -Wenn Sie das Script so ausführen wollen, dass es an das Terminal angehängt wird, müssen Sie `start` weglassen: - -```console -$ forever script.js -``` - -Es ist sinnvoll, Ausgaben des Forever-Tools und des Scripts mit den Protokollierungsoptionen `-l`, `-o` und `-e` zu protokollieren (wie in diesem Beispiel gezeigt): - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -Anzeigen der Liste mit Scripts, die über Forever gestartet wurden: - -```console -$ forever list -``` - -Stoppen eines Scripts, das über Forever gestartet wurde. Verwenden Sie hierzu den Befehl `forever stop` und geben Sie den Prozessindex an (der über den Befehl `forever list` erstellt wird). - -```console -$ forever stop 1 -``` - -Geben Sie alternativ den Pfad zur Datei an: - -```console -$ forever stop script.js -``` - -Stoppen aller Scripts, die über Forever gestartet wurden: - -```console -$ forever stopall -``` - -Forever verfügt über eine Vielzahl von Optionen sowie eine programmgesteuerte API. diff --git a/de/resources/learning.md b/de/resources/learning.md deleted file mode 100755 index 5529984543..0000000000 --- a/de/resources/learning.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -layout: page -title: Zusätzliches Lernen -menu: resources -lang: de ---- - -# Zusätzliches Lernen - -
    Disclaimer: Unendorsed community content.
    - -## Books - -Here are a few of the many books on Express: - - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, early 2015. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) - -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings. diff --git a/en/advanced/best-practice-performance.md b/en/advanced/best-practice-performance.md index f15742f11d..3d8eda5080 100644 --- a/en/advanced/best-practice-performance.md +++ b/en/advanced/best-practice-performance.md @@ -230,7 +230,7 @@ The most popular process managers for Node are as follows: * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -For a feature-by-feature comparison of the three process managers, see [http://strong-pm.io/compare/](http://strong-pm.io/compare/). For a more detailed introduction to all three, see [Process managers for Express apps](/{{ page.lang }}/advanced/pm.html). +For a feature-by-feature comparison of the three process managers, see [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Using any of these process managers will suffice to keep your application up, even if it does crash from time to time. diff --git a/en/advanced/healthcheck-graceful-shutdown.md b/en/advanced/healthcheck-graceful-shutdown.md index 10c3c1e418..22d6f3baca 100644 --- a/en/advanced/healthcheck-graceful-shutdown.md +++ b/en/advanced/healthcheck-graceful-shutdown.md @@ -10,9 +10,10 @@ redirect_from: "/advanced/healthcheck-graceful-shutdown.html" ## Graceful shutdown -When you deploy a new version of your application, you must replace the previous version. The [process manager](pm.html) you're using will first send a `SIGTERM` signal to the application to notify it that it will be killed. Once the application gets this signal, it should stop accepting new requests, finish all the ongoing requests, clean up the resources it used, including database connections and file locks then exit. +When you deploy a new version of your application, you must replace the previous version. The process manager you're using will first send a SIGTERM signal to the application to notify it that it will be killed. Once the application gets this signal, it should stop accepting new requests, finish all the ongoing requests, clean up the resources it used, including database connections and file locks then exit. + +### Example -### Example Graceful Shutdown ```js const server = app.listen(port) @@ -30,150 +31,3 @@ A load balancer uses health checks to determine if an application instance is he * `liveness`, that determines when to restart a container. * `readiness`, that determines when a container is ready to start accepting traffic. When a pod is not ready, it is removed from the service load balancers. - -## Third-party solutions - -{% include community-caveat.html %} - -### Terminus - -[Terminus](https://github.com/godaddy/terminus) is an open-source project that adds health checks and graceful shutdown to your application to eliminate the need to write boilerplate code. You just provide the cleanup logic for graceful shutdowns and the health check logic for health checks, and terminus handles the rest. - -Install terminus as follows: - -```console -$ npm i @godaddy/terminus --save -``` - -Here's a basic template that illustrates using terminus. For more information, see . - -```js -const http = require('http') -const express = require('express') -const { createTerminus } = require('@godaddy/terminus') - -const app = express() - -app.get('/', (req, res) => { - res.send('ok') -}) - -const server = http.createServer(app) - -function onSignal () { - console.log('server is starting cleanup') - // start cleanup of resource, like databases or file descriptors -} - -async function onHealthCheck () { - // checks if the system is healthy, like the db connection is live - // resolves, if health, rejects if not -} - -createTerminus(server, { - signal: 'SIGINT', - healthChecks: { '/healthcheck': onHealthCheck }, - onSignal -}) - -server.listen(3000) -``` - -### Lightship - -[Lightship](https://github.com/gajus/lightship) is an open-source project that adds health, readiness and liveness checks to your application. Lightship is a standalone HTTP-service that runs as a separate HTTP service; this allows having health-readiness-liveness HTTP endpoints without exposing them on the public interface. - -Install Lightship as follows: - -```console -$ npm install lightship -``` - -Basic template that illustrates using Lightship: - -```js -const http = require('http') -const express = require('express') -const { - createLightship -} = require('lightship') - -// Lightship will start a HTTP service on port 9000. -const lightship = createLightship() - -const app = express() - -app.get('/', (req, res) => { - res.send('ok') -}) - -app.listen(3000, () => { - lightship.signalReady() -}) - -// You can signal that the service is not ready using `lightship.signalNotReady()`. -``` - -[Lightship documentation](https://github.com/gajus/lightship) provides examples of the corresponding [Kubernetes configuration](https://github.com/gajus/lightship#lightship-usage-kubernetes-container-probe-configuration) and a complete example of integration with [Express.js](https://github.com/gajus/lightship#using-with-expressjs). - -### http-terminator - -[http-terminator](https://github.com/gajus/http-terminator) implements logic for gracefully terminating an Express server. - -Terminating a HTTP server in Node.js requires keeping track of all open connections and signaling them that the server is shutting down. `http-terminator` implements the logic for tracking all connections and their termination upon a timeout. `http-terminator` also ensures graceful communication of the server intention to shutdown to any clients that are currently receiving response from this server. - -Install `http-terminator` as follows: - -```console -$ npm install http-terminator -``` - -Basic template that illustrates using http-terminator: - -```js -const express = require('express') -const { createHttpTerminator } = require('http-terminator') - -const app = express() - -const server = app.listen(3000) - -const httpTerminator = createHttpTerminator({ server }) - -app.get('/', (req, res) => { - res.send('ok') -}) - -// A server will terminate after invoking `httpTerminator.terminate()`. -// Note: Timeout is used for illustration of delayed termination purposes only. -setTimeout(() => { - httpTerminator.terminate() -}, 1000) -``` - -[http-terminator documentation](https://github.com/gajus/http-terminator) provides API documentation and comparison to other existing third-party solutions. - -### express-actuator - -[express-actuator](https://github.com/rcruzper/express-actuator) is a middleware to add endpoints to help you monitor and manage applications. - -Install `express-actuator` as follows: - -```console -$ npm install --save express-actuator -``` - -Basic template that illustrates using `express-actuator`: - -```js -const express = require('express') -const actuator = require('express-actuator') - -const app = express() - -app.use(actuator()) - -app.listen(3000) -``` - -The [express-actuator documentation](https://github.com/rcruzper/express-actuator) provides different options for customization. diff --git a/en/advanced/pm.md b/en/advanced/pm.md deleted file mode 100755 index 7cb0bdafde..0000000000 --- a/en/advanced/pm.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -layout: page -title: Process managers for Express apps -menu: advanced -lang: en -redirect_from: "/advanced/pm.html" ---- - -# Process managers for Express apps - -{% include community-caveat.html %} - -When you run Express apps for production, it is helpful to use a _process manager_ to: - -- Restart the app automatically if it crashes. -- Gain insights into runtime performance and resource consumption. -- Modify settings dynamically to improve performance. -- Control clustering. - -A process manager is somewhat like an application server: it's a "container" for applications that facilitates deployment, provides high availability, and enables you to manage the application at runtime. - -The most popular process managers for Express and other Node.js applications are: - -- **[Nodemon](https://nodemon.io){: target="_blank"}**: Monitor for any changes in your source and automatically restart your server. -- **[PM2](https://github.com/Unitech/pm2){: target="_blank"}**: A production process manager for Node.js applications that has a built-in load balancer. PM2 enables you to keep applications alive forever, reloads them without downtime, helps you to manage application logging, monitoring, and clustering. -- **[StrongLoop Process Manager (Strong-PM)](http://strong-pm.io/)**: A production process manager for Node.js applications with built-in load balancing, monitoring, and multi-host deployment. Includes a CLI to build, package, and deploy Node.js applications to a local or remote system. -- **SystemD**: The default process manager on modern Linux distributions, that makes it simple to run a Node application as a service. For more information, see ["Run node.js service with systemd" by Ralph Slooten (@axllent)](https://www.axllent.org/docs/view/nodejs-service-with-systemd/). diff --git a/en/resources/community.md b/en/resources/community.md index 6550ddcb46..e6304757f5 100755 --- a/en/resources/community.md +++ b/en/resources/community.md @@ -39,8 +39,7 @@ Members of the Express technical committee are: ## Express is made of many modules Our vibrant community has created a large variety of extensions, -[middleware modules](/{{ page.lang }}/resources/middleware.html) and -[higher-level frameworks](frameworks.html). +[middleware modules](/{{ page.lang }}/resources/middleware.html) and higher-level frameworks. Additionally, the Express community maintains modules in these two GitHub orgs: diff --git a/en/resources/companies-using-express.md b/en/resources/companies-using-express.md deleted file mode 100644 index 7274e2cd47..0000000000 --- a/en/resources/companies-using-express.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -layout: page -title: Companies using Express -menu: resources -lang: en -redirect_from: "/resources/companies-using-express.html" ---- - -# Companies using Express in production - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    diff --git a/en/resources/frameworks.md b/en/resources/frameworks.md deleted file mode 100644 index 86b791bee8..0000000000 --- a/en/resources/frameworks.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -layout: page -title: Frameworks built on Express -menu: frameworks -lang: en ---- - -# Frameworks built on Express - -{% include community-caveat.html %} - -Several popular Node.js frameworks are built on Express: - -- **[Feathers](http://feathersjs.com)**: Build prototypes in minutes and production ready real-time apps in days. -- **[ItemsAPI](https://www.itemsapi.com/)**: Search backend for web and mobile applications built on Express and Elasticsearch. -- **[KeystoneJS](http://keystonejs.com/)**: Website and API Application Framework / CMS with an auto-generated React.js Admin UI. -- **[Poet](http://jsantell.github.io/poet)**: Lightweight Markdown Blog Engine with instant pagination, tag and category views. -- **[Kraken](http://krakenjs.com/)**: Secure and scalable layer that extends Express by providing structure and convention. -- **[LoopBack](http://loopback.io)**: Highly-extensible, open-source Node.js framework for quickly creating dynamic end-to-end REST APIs. -- **[Sails](http://sailsjs.org/)**: MVC framework for Node.js for building practical, production-ready apps. -- **[Hydra-Express](https://github.com/flywheelsports/fwsp-hydra-express)**: Hydra-Express is a light-weight library which facilitates building Node.js Microservices using ExpressJS. -- **[Blueprint](http://github.com/onehilltech/blueprint)**: a SOLID framework for building APIs and backend services -- **[Locomotive](http://locomotivejs.org/)**: Powerful MVC web framework for Node.js from the maker of Passport.js -- **[graphql-yoga](https://github.com/graphcool/graphql-yoga)**: Fully-featured, yet simple and lightweight GraphQL server -- **[Express Gateway](https://express-gateway.io)**: Fully-featured and extensible API Gateway using Express as foundation -- **[Dinoloop](https://github.com/ParallelTask/dinoloop)**: Rest API Application Framework powered by typescript with dependency injection -- **[Kites](https://kites.nodejs.vn/)**: Template-based Web Application Framework -- **[FoalTS](https://foalts.org/)**: Elegant and all-inclusive Node.Js web framework based on TypeScript. -- **[NestJs](https://github.com/nestjs/nest)**: A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications on top of TypeScript & JavaScript (ES6, ES7, ES8) -- **[Expressive Tea](https://github.com/Zero-OneiT/expresive-tea)**: A Small framework for building modulable, clean, fast and descriptive server-side applications with Typescript and Express out of the box. diff --git a/en/resources/learning.md b/en/resources/learning.md deleted file mode 100644 index bef526874b..0000000000 --- a/en/resources/learning.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -layout: page -title: Additional learning -menu: resources -lang: en -redirect_from: "/resources/learning.html" ---- - -# Additional learning - -{% include community-caveat.html %} - -## Books - -Here are a few of the many books on Express: - -- **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, April 2016. - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Getting MEAN with Mongo, Express, Angular, and Node, Second Edition](http://www.manning.com/sholmes2/)**, -Manning Publications, April 2017. - - **[Pro Express.js: Master Express.js: The Node.js Framework For Your Web Development](http://www.apress.com/9781484200384)**, -Apress, December 2014. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 -- **[Builder Book: Build a Full Stack JavaScript Web App from Scratch](https://builderbook.org)**, self-published, February 2018. -- **[MERN Quick Start Guide](https://www.amazon.com/dp/1787281086)**, Packt Publishing, May 2018 -- **[Functional Design Patterns for Express.js](https://jonathanleemartin.com/books/)**, self-published, June 2019. -- **[SaaS Boilerplate Book: Build a Production-Ready SaaS Web App from Scratch](https://builderbook.org/book)**, self-published, August 2020. - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](https://strongloop.com/strongblog/tag_Express.html) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) -- [Baboon Blog: Express category](http://www.baboon.ir/tutorials/expressjs/) (Persian language) -- [Techforgeek Blog: Express category](http://techforgeek.com/expressjs/) -- [RoseHosting.com Blog: Express tag](https://www.rosehosting.com/blog/tag/express/) -- [ThisHosting.Rocks: Express tag](https://thishosting.rocks/tag/express-js/) -- [Code with Hugo blog: Express tag](https://codewithhugo.com/tags/express) -- [Dev.to blog: Express category](https://dev.to/ghvstcode/understanding-express-middleware-a-beginners-guide-g73) -- [LinuxStans Blog: Express tag](https://linuxstans.com/tag/express-js/) -- [ButterCMS blog: Express category](https://buttercms.com/blog/tag/express/) -- [Traveling Coderman Blog: Architecture Series](https://traveling-coderman.net/code/node-architecture/) - -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## The DEV community - -[DEV's express tag](https://dev.to/t/express) is a place to share Express projects, articles and tutorials as well as start discussions and ask for feedback on Express-related topics. Developers of all skill-levels are welcome to take part. - -## Video tutorials -- [Learning ExpressJS: Express category](https://getbuzz.io/c/learning-expressjs) -- [Learn Express.js in 14 days](https://iLoveCoding.org/courses/expressjs) - Practice Projects included diff --git a/en/resources/open-source-using-express.md b/en/resources/open-source-using-express.md deleted file mode 100644 index 8cc8f6df40..0000000000 --- a/en/resources/open-source-using-express.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -layout: page -title: Open source using Express -menu: resources -lang: en -redirect_from: "/resources/open-source-using-express.html" ---- - -# Open source projects using Express - -{% include community-caveat.html %} - -Some open-source projects that use Express: - -- **[Builder Book](https://github.com/builderbook/builderbook)**: Open source web app to publish documentation or books. Built with React, Material-UI, Next, Express, Mongoose, MongoDB. -- **[SaaS Boilerplate](https://github.com/async-labs/saas)**: Open source web app to build your own SaaS product. Built with React, Material-UI, Next, MobX, Express, Mongoose, MongoDB, Typescript. -- **[BitMidi](https://bitmidi.com)**: Open source web app powered by Express. BitMidi is a historical archive of MIDI files from the early web era. It uses the latest modern web technology including WebAssembly and Web Audio to bring MIDI back to life. ([source code](https://github.com/feross/bitmidi.com)) diff --git a/en/resources/template-engines.md b/en/resources/template-engines.md deleted file mode 100644 index cf1091cf80..0000000000 --- a/en/resources/template-engines.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -layout: page -title: Template Engines -menu: resources -lang: en -redirect_from: "/resources/template-engines.html" ---- - -# Template engines - -{% include warning.html content="The packages listed below may be outdated, no longer maintained or even broken. Listing here does not constitute an endorsement or recommendation from the Expressjs project team. Use at your own risk." %} - -These template engines work "out-of-the-box" with Express: - -- **[Pug](https://github.com/pugjs/pug)**: Haml-inspired template engine (formerly Jade). -- **[Haml.js](https://github.com/tj/haml.js)**: Haml implementation. -- **[EJS](https://github.com/mde/ejs)**: Embedded JavaScript template engine. -- **[hbs](https://github.com/pillarjs/hbs)**: Adapter for Handlebars.js, an extension of Mustache.js template engine. -- **[Squirrelly](https://github.com/squirrellyjs/squirrelly)**: Blazing-fast template engine that supports partials, helpers, custom tags, filters, and caching. Not white-space sensitive, works with any language. -- **[Eta](https://github.com/eta-dev/eta)**: Super-fast lightweight embedded JS template engine. Supports custom delimiters, async, whitespace control, partials, caching, plugins. -- **[combyne.js](https://github.com/tbranyen/combyne)**: A template engine that hopefully works the way you'd expect. -- **[Nunjucks](https://github.com/mozilla/nunjucks)**: Inspired by jinja/twig. -- **[marko](https://github.com/marko-js/marko)**: A fast and lightweight HTML-based templating engine that compiles templates to CommonJS modules and supports streaming, async rendering and custom tags. (Renders directly to the HTTP response stream). -- **[whiskers](https://github.com/gsf/whiskers.js)**: Small, fast, mustachioed. -- **[Blade](https://github.com/bminer/node-blade)**: HTML Template Compiler, inspired by Jade & Haml. -- **[Haml-Coffee](https://github.com/netzpirat/haml-coffee)**: Haml templates where you can write inline CoffeeScript. -- **[express-hbs](https://github.com/barc/express-hbs)**: Handlebars with layouts, partials and blocks for express 3 from Barc. -- **[express-handlebars](https://github.com/express-handlebars/express-handlebars)**: A Handlebars view engine for Express which doesn't suck. -- **[express-views-dom](https://github.com/AndersDJohnson/express-views-dom)**: A DOM view engine for Express. -- **[rivets-server](https://github.com/AndersDJohnson/rivets-server)**: Render Rivets.js templates on the server. -- **[LiquidJS](https://github.com/harttle/liquidjs)**: A simple, expressive and safe template engine. -- **[express-tl](https://github.com/Drulac/express-tl)**: A template-literal engine implementation for Express. -- **[Twing](https://www.npmjs.com/package/twing)**: First-class Twig engine for Node.js. -- **[Sprightly](https://www.npmjs.com/package/sprightly)**: A very light-weight JS template engine (45 lines of code), that consists of all the bare-bones features that you want to see in a template engine. -- **[html-express-js](https://www.npmjs.com/package/html-express-js)**: A small template engine for those that want to just serve static or dynamic HTML pages using native JavaScript. - -The [Consolidate.js](https://github.com/tj/consolidate.js) library unifies the APIs of these template engines to a single Express-compatible API. - - - -### Add your template engine here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/en/resources/template-engines.md) and add a link to your project, then submit a pull request (GitHub login required). Follow the format of the above listings. diff --git a/es/advanced/best-practice-performance.md b/es/advanced/best-practice-performance.md index 2a1c8df5c0..6803cb2b83 100755 --- a/es/advanced/best-practice-performance.md +++ b/es/advanced/best-practice-performance.md @@ -242,7 +242,7 @@ Los gestores de procesos más conocidos para Node son los siguientes: - [PM2](https://github.com/Unitech/pm2) - [Forever](https://www.npmjs.com/package/forever) -Para ver una comparación característica a característica de los tres gestores de procesos, consulte [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Para ver una introducción más detallada de los tres, consulte [Gestores de procesos para las aplicaciones Express](/{{ page.lang }}/advanced/pm.html). +Para ver una comparación característica a característica de los tres gestores de procesos, consulte [http://strong-pm.io/compare/](http://strong-pm.io/compare/). El uso de cualquiera de estos gestores de procesos bastará para mantener activa la aplicación, aunque se bloquee cada cierto tiempo. diff --git a/es/advanced/pm.md b/es/advanced/pm.md deleted file mode 100755 index 00aeda3400..0000000000 --- a/es/advanced/pm.md +++ /dev/null @@ -1,239 +0,0 @@ ---- -layout: page -title: Gestores de procesos para las aplicaciones Express -menu: advanced -lang: es ---- - -# Gestores de procesos para las aplicaciones Express - -Cuando ejecuta aplicaciones Express en producción, es muy útil utilizar un *gestor de procesos* para realizar las siguientes tareas: - -- Reiniciar la aplicación automáticamente si se bloquea. -- Obtener información útil sobre el rendimiento en tiempo de ejecución y el consumo de recursos. -- Modificar dinámicamente los valores para mejorar el rendimiento. -- Controlar la agrupación en clúster. - -Un gestor de procesos es una especie de servidor de aplicaciones: un "contenedor" de aplicaciones que facilita el despliegue, proporciona una alta disponibilidad y permite gestionar la aplicación en el tiempo de ejecución. - -Los gestores de procesos más conocidos para Express y otras aplicaciones Node.js son los siguientes: - -- [StrongLoop Process Manager](#sl) -- [PM2](#pm2) -- [Forever](#forever) - - -El uso de estas tres herramientas puede ser muy útil, aunque StrongLoop Process Manager es la única que proporciona una solución completa de despliegue y tiempo de ejecución que gestiona el ciclo de vida completo de la aplicación Node.js, con herramientas para cada paso antes y después de la producción, en una interfaz unificada. - -A continuación, se describe brevemente cada una de estas herramientas. -Para ver una comparación detallada, consulte [http://strong-pm.io/compare/](http://strong-pm.io/compare/). - -## StrongLoop Process Manager - -StrongLoop Process Manager (StrongLoop PM) es un gestor de procesos de producción para las aplicaciones Node.js. StrongLoop PM tiene incorporado un despliegue de equilibrio de carga, supervisión y varios hosts, así como una consola gráfica. -Puede utilizar StrongLoop PM para las siguientes tareas: - -- Crear, empaquetar y desplegar la aplicación Node.js en un sistema local o remoto. -- Ver perfiles de CPU e instantáneas de almacenamiento dinámico para optimizar el rendimiento y diagnosticar fugas de memoria. -- Mantener activos siempre los clústeres y los procesos. -- Ver medidas de rendimiento sobre la aplicación. -- Gestionar fácilmente los despliegues de varios hosts con la integración de Nginx. -- Unificar varios StrongLoop PM en un tiempo de ejecución de microservicios distribuidos que se gestiona desde Arc. - -Puede trabajar con StrongLoop PM utilizando una potente herramienta de interfaz de línea de mandatos denominada `slc` o una herramienta gráfica denominada Arc. Arc es de código abierto, con soporte profesional proporcionado por StrongLoop. - -Para obtener más información, consulte [http://strong-pm.io/](http://strong-pm.io/). - -Documentación completa: - -- [Operating Node apps (documentación de StrongLoop)](http://docs.strongloop.com/display/SLC) -- [Using StrongLoop Process Manager](http://docs.strongloop.com/display/SLC/Using+Process+Manager). - -### Instalación - -```console -$ [sudo] npm install -g strongloop -``` - -### Uso básico - -```console -$ cd my-app -$ slc start -``` - -Vea el estado del gestor de procesos y todas las aplicaciones desplegadas: - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -Liste todas las aplicaciones (servicios) que se están gestionando: - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -Detenga una aplicación: - -```console -$ slc ctl stop my-app -``` - -Reinicie una aplicación: - -```console -$ slc ctl restart my-app -``` - -También puede realizar un "reinicio suave", que da a los procesos de trabajador un periodo de gracia para cerrar las conexiones existentes y, a continuación, reinicia la aplicación actual: - -```console -$ slc ctl soft-restart my-app -``` - -Para eliminar una aplicación de la gestión: - -```console -$ slc ctl remove my-app -``` - -## PM2 - -PM2 es un gestor de procesos de producción para las aplicaciones Node.js que tiene un equilibrador de carga incorporado. PM2 permite mantener siempre activas las aplicaciones y volver a cargarlas sin ningún tiempo de inactividad, a la vez que facilita tareas comunes de administrador del sistema. PM2 también permite gestionar el registro de aplicaciones, la supervisión y la agrupación en clúster. - -Para obtener más información, consulte [https://github.com/Unitech/pm2](https://github.com/Unitech/pm2). - -### Instalación - -```console -$ [sudo] npm install pm2 -g -``` - -### Uso básico - -Cuando inicia una aplicación utilizando el mandato `pm2`, debe especificar la vía de acceso de la aplicación. No obstante, cuando detiene, reinicia o suprime una aplicación, sólo puede especificar el nombre o el ID de la aplicación. - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use the `pm2 show ` command to get more details about an app. -``` - -Cuando inicia una aplicación utilizando el mandato `pm2`, la aplicación se envía inmediatamente al segundo plano. Puede controlar la aplicación en segundo plano desde la línea de mandatos utilizando varios mandatos `pm2`. - -Cuando se inicia una aplicación utilizando el mandato `pm2`, se registra en la lista de procesos de PM2 con un ID. Por lo tanto, puede gestionar las aplicaciones con el mismo nombre de distintos directorios en el sistema utilizando su ID. - -Tenga en cuenta que si se ejecuta más de una aplicación con el mismo nombre, los mandatos `pm2` se aplican en todas ellas. Por lo tanto, utilice ID en lugar de nombres para gestionar aplicaciones individuales. - -Liste todos los procesos en ejecución: - -```console -$ pm2 list -``` - -Detenga una aplicación: - -```console -$ pm2 stop 0 -``` - -Reinicie una aplicación: - -```console -$ pm2 restart 0 -``` - -Para ver información detallada sobre una aplicación: - -```console -$ pm2 show 0 -``` - -Para eliminar una aplicación del registro de PM2: - -```console -$ pm2 delete 0 -``` - - -## Forever - -Forever es una herramienta de interfaz de línea de mandatos simple que permite garantizar la ejecución continua (forever/siempre) de un determinado script. La sencilla interfaz de Forever hace que sea ideal para ejecutar los despliegues más pequeños de scripts y aplicaciones Node.js. - -Para obtener más información, consulte [https://github.com/foreverjs/forever](https://github.com/foreverjs/forever). - -### Instalación - -```console -$ [sudo] npm install forever -g -``` - -### Uso básico - -Para iniciar un script, utilice el mandato `forever start` y especifique la vía de acceso del script: - -```console -$ forever start script.js -``` - -Este mandato ejecutará el script en modalidad daemon (en segundo plano). - -Para ejecutar el script para que se adjunte al terminal, omita `start`: - -```console -$ forever script.js -``` - -Se recomienda registrar la salida de la herramienta Forever y el script utilizando las opciones de registro `-l`, `-o` y `-e`, como se muestra en este ejemplo: - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -Para ver la lista de scripts que ha iniciado Forever: - -```console -$ forever list -``` - -Para detener un script iniciado por Forever, utilice el mandato `forever stop` y especifique el índice de procesos (como se lista con el mandato `forever list`). - -```console -$ forever stop 1 -``` - -De manera alternativa, puede especificar la vía de acceso del archivo: - -```console -$ forever stop script.js -``` - -Para detener todos los scripts que ha iniciado Forever: - -```console -$ forever stopall -``` - -Forever tiene más opciones y también proporciona una API mediante programación. diff --git a/es/resources/learning.md b/es/resources/learning.md deleted file mode 100755 index df8b5952d8..0000000000 --- a/es/resources/learning.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -layout: page -title: Aprendizaje adicional -menu: resources -lang: es ---- - -# Aprendizaje adicional - -
    Disclaimer: Unendorsed community content.
    - -## Books - -Here are a few of the many books on Express: - - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, early 2015. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) - -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings. diff --git a/fr/advanced/best-practice-performance.md b/fr/advanced/best-practice-performance.md index be1e5e5c3a..f93653c974 100755 --- a/fr/advanced/best-practice-performance.md +++ b/fr/advanced/best-practice-performance.md @@ -243,7 +243,7 @@ Les gestionnaires de processus les plus populaires pour Node sont les suivants : * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -Pour obtenir une comparaison détaillée de ces trois gestionnaires de processus, voir [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Pour obtenir une présentation détaillée, voir [Gestionnaires de processus pour les applications Express](/{{ page.lang }}/advanced/pm.html). +Pour obtenir une comparaison détaillée de ces trois gestionnaires de processus, voir [http://strong-pm.io/compare/](http://strong-pm.io/compare/). L'utilisation de l'un de ces trois gestionnaires de processus suffira à garder votre application active, même si elle plantera de temps en temps. diff --git a/fr/advanced/pm.md b/fr/advanced/pm.md deleted file mode 100755 index b2f45d6a74..0000000000 --- a/fr/advanced/pm.md +++ /dev/null @@ -1,268 +0,0 @@ ---- -layout: page -title: Gestionnaires de processus pour les applications Express -menu: advanced -lang: fr ---- - -# Gestionnaires de processus pour les applications Express - -Quand vous exécutez l'application Express pour la -production, utilisez un *gestionnaire de -processus* car celui-ci peut vous permettre : - -- De redémarrer l'application manuellement si elle subit une panne. -- De vous informer sur les performances d'exécution et la consommation des ressources. -- De modifier les paramètres de manière dynamique afin d'améliorer les performances. -- De contrôler la mise en cluster. - -Un gestionnaire de processus est quelque sorte un "conteneur" d'applications qui facilite le déploiement, offre une haute disponibilité et vous permet de gérer l'application lors de son exécution. - -Les gestionnaires de processus les plus populaires pour Express et d'autres applications Node.js sont les suivants : - -- [StrongLoop Process Manager](#sl) -- [PM2](#pm2) -- [Forever](#forever) - - -L'utilisation d'un de ces trois outils peut être très utile, cependant le gestionnaire de processus StrongLoop est le seul qui fournisse un délai d'exécution exhaustif ainsi qu'une solution de déploiement qui s'adresse à l'intégralité du cycle de vie de l'application, avec des outils pour chaque étape avant et après la production, le tout dans une interface unifiée. - -Voici un bref aperçu de chacun de ces outils. -Pour une comparaison détaillée, voir [http://strong-pm.io/compare/](http://strong-pm.io/compare/). - -## StrongLoop Process Manager - -Le gestionnaire de processus StrongLoop (StrongLoop PM) est un gestionnaire de processus de production pour les applications Node.js. StrongLoop PM possède un équilibrage de charge, une surveillance et un déploiement multi-hôte, ainsi qu'une console graphique intégrés. -Vous pouvez utiliser StrongLoop PM pour les tâches suivantes : - -- Construire, combiner et déployer votre application Node.js à un système local ou distant. -- Afficher les profils d'UC et les instantanés de segment de mémoire pour optimiser les performances et diagnostiquer les fuites de mémoire. -- Conserver des processus et des clusters avec une durée de vie illimitée. -- Afficher les indicateurs de performance dans votre application. -- Gérer facilement les déploiements multi-hôtes avec l'intégration Nginx. -- Unifier plusieurs StrongLoop PM avec un délai d'exécution des microservices réparti et qui est géré par Arc. - -Vous pouvez utiliser StrongLoop PM en passant par un puissant outil d'interface de ligne de commande appelé `slc`, ou un outil graphique appelé Arc. Arc est un code source ouvert, avec une prise en charge professionnelle fournie par StrongLoop. - -Pour plus d'informations, voir [http://strong-pm.io/](http://strong-pm.io/). - -Documentation complète : - -- [Utilisation des applications Node (documentation StrongLoop)](http://docs.strongloop.com/display/SLC) -- [Utilisation du gestionnaire de processus StrongLoop](http://docs.strongloop.com/display/SLC/Using+Process+Manager). - -### Installation - -```console -$ [sudo] npm install -g strongloop -``` - -### Utilisation de base - -```console -$ cd my-app -$ slc start -``` - -Afficher le statut du gestionnaire de processus ainsi que de toutes les applications déployées : - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -Lister toutes les applications (services) sous gestion : - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -Arrêter une application : - -```console -$ slc ctl stop my-app -``` - -Redémarrer une application : - -```console -$ slc ctl restart my-app -``` - -Vous pouvez également "redémarrer en douceur", ce qui donne aux -processus de traitement un délai supplémentaire afin de fermer les -connexions existantes, et permet un redémarrage des applications en -cours : - -```console -$ slc ctl soft-restart my-app -``` - -Supprimer une application de la gestion : - -```console -$ slc ctl remove my-app -``` - -## PM2 - -PM2 est un gestionnaire de processus de production pour les -applications Node.js, qui possède un équilibreur de charge intégré. PM2 -vous permet de conserver des applications avec une durée de vie -illimitée et de les recharger sans temps d'arrêt, ce qui facilite -les tâches de l'administrateur système commun. PM2 vous permet -également de gérer la journalisation, la surveillance et le -regroupement de l'application. - -Pour plus d'informations, voir [https://github.com/Unitech/pm2](https://github.com/Unitech/pm2). - -### Installation - -```console -$ [sudo] npm install pm2 -g -``` - -### Utilisation de base - -Quand vous démarrez une application en utilisant la commande `pm2` vous devez indiquer le chemin d'accès de -l'application. Cependant, quand vous arrêtez, redémarrez ou supprimez -une application, vous pouvez n'indiquer que le nom ou l'ID de -l'application. - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use the `pm2 show ` command to get more details about an app. -``` - -Quand vous démarrez une application à l'aide de la -commande `pm2`, l'application est immédiatement -envoyée en arrière-plan. Vous pouvez contrôler l'application -en arrière-plan à partir de la ligne de commande en utilisant diverses -commandes `pm2`. - -Après qu'une application a été démarrée en utilisant la -commande `pm2`, elle est enregistrée dans la liste -de processus de PM2 avec un ID. Vous pouvez donc gérer les -applications avec le même nom à partir de répertoires différents -dans le système, en utilisant leurs ID. - -Notez que si plusieurs application avec le même nom sont en -cours d'exécution, les commandes `pm2` les -affecteront toutes. Il vaut donc mieux utiliser les ID plutôt que les -noms pour gérer les applications individuelles. - -Lister tous les processus en cours : - -```console -$ pm2 list -``` - -Arrêter une application : - -```console -$ pm2 stop 0 -``` - -Redémarrer une application : - -```console -$ pm2 restart 0 -``` - -Pour afficher les informations détaillées d'une application : - -```console -$ pm2 show 0 -``` - -Pour supprimer une application du registre PM2 : - -```console -$ pm2 delete 0 -``` - - -## Forever - -Forever est un simple outil d'interface de ligne de commande qui permet de s'assurer qu'un script donné est exécuté de façon continue (forever). L'interface simple de Forever en fait un -outil idéal pour exécuter des déploiements plus petits des applications et des scripts de Node.jps. - -Pour plus d'informations, voir [https://github.com/foreverjs/forever](https://github.com/foreverjs/forever). - -### Installation - -```console -$ [sudo] npm install forever -g -``` - -### Utilisation de base - -Pour démarrer un script, utilisez la commande `forever start` et indiquez le chemin d'accès du script : - -```console -$ forever start script.js -``` - -Cette commande exécutera le script en mode démon (à l'arrière-plan). - -Pour exécuter le script de façon à ce qu'il soit joint au terminal, il ne faut pas prendre en compte `start` : - -```console -$ forever script.js -``` - -C'est une bonne idée de consigner votre sortie du script et de -l'outil Forever en utilisant les options de consignation `-l`, `-o` et `-e`, comme illustré dans l'exemple suivant : - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -Pour visualiser la liste des scripts qui ont été démarrés par Forever : - -```console -$ forever list -``` - -Pour arrêter un script qui a été démarré par Forever, utilisez -la commande `forever stop` et indiquez l'index de -processus (tel qu'il est listé par la commande `forever list`). - -```console -$ forever stop 1 -``` - -Sinon, indiquez le chemin d'accès du fichier : - -```console -$ forever stop script.js -``` - -Pour arrêter tous les scripts qui ont été démarrés par Forever : - -```console -$ forever stopall -``` - -Forever possède beaucoup d'autres options, et il fournit également une API programmable. diff --git a/fr/resources/learning.md b/fr/resources/learning.md deleted file mode 100755 index c786957750..0000000000 --- a/fr/resources/learning.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -layout: page -title: Apprentissage supplémentaire -menu: resources -lang: fr ---- - -# Apprentissage supplémentaire - -
    Disclaimer: Unendorsed community content.
    - -## Books - -Here are a few of the many books on Express: - - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, early 2015. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) - -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings. diff --git a/index.md b/index.md index 357dac19be..d561db702a 100644 --- a/index.md +++ b/index.md @@ -35,8 +35,10 @@ redirect_from: "/en/index.html"

    Performance

    Express provides a thin layer of fundamental web application features, without obscuring Node.js features that you know and love. -
    -

    Frameworks

    Many popular frameworks are based on Express. +
    +

    Middleware

    + Express is a lightweight and flexible routing framework with minimal core features + meant to be augmented through the use of Express middleware modules.
    diff --git a/it/advanced/best-practice-performance.md b/it/advanced/best-practice-performance.md index 1543bd77f3..78f49ee0a9 100755 --- a/it/advanced/best-practice-performance.md +++ b/it/advanced/best-practice-performance.md @@ -243,7 +243,7 @@ I process manager più noti per Node sono i seguenti: * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -Per un paragone a livello di funzioni dei tre process manager, consultare l'indirizzo [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Per informazioni più dettagliate su tutti e tre i process manager, consultare [Process manager per le applicazioni Express](/{{ page.lang }}/advanced/pm.html). +Per un paragone a livello di funzioni dei tre process manager, consultare l'indirizzo [http://strong-pm.io/compare/](http://strong-pm.io/compare/). L'utilizzo di questi process manager sarà sufficiente per far restare attiva l'applicazione, anche se dovesse capitare che si arresti in modo anomalo. diff --git a/it/advanced/pm.md b/it/advanced/pm.md deleted file mode 100755 index e38f9502aa..0000000000 --- a/it/advanced/pm.md +++ /dev/null @@ -1,239 +0,0 @@ ---- -layout: page -title: Process manager per le applicazioni Express -menu: advanced -lang: it ---- - -# Process manager per le applicazioni Express - -Quando si eseguono le applicazioni Express per la produzione, è utile utilizzare un *process manager* per effettuare le seguenti attività: - -- Riavviare l'applicazione automaticamente se termina in modo anomalo. -- Ottenere insight relativi alle prestazioni di runtime e al consumo delle risorse. -- Modificare le impostazioni in modo dinamico per migliorare le prestazioni. -- Controllare il processo di clustering. - -Un process manager è simile a un server delle applicazioni: è un "contenitore" per le applicazioni che facilita lo sviluppo, fornisce un'elevata disponibilità e consente di gestire l'applicazione al momento del runtime. - -I process manager più noti per Express e altre applicazioni Node.js sono i seguenti: - -- [StrongLoop Process Manager](#sl) -- [PM2](#pm2) -- [Forever](#forever) - - -L'utilizzo di uno di questi tre strumenti può essere molto utile, tuttavia, StrongLoop Process Manager è l'unico strumento che fornisce una soluzione di distribuzione e runtime completa che interessa il ciclo di vita dell'intera applicazione Node.js, con la possibilità di usufruire di strumenti in ciascuna fase prima e dopo la produzione, in un'interfaccia unificata. - -Segue una breve descrizione relativa ad ogni strumento. -Per un confronto dettagliato, consultare [http://strong-pm.io/compare/](http://strong-pm.io/compare/). - -## StrongLoop Process Manager - -StrongLoop Process Manager (StrongLoop PM) è un process manager di produzione per le applicazioni Node.js. StrongLoop PM dispone di servizi di bilanciamento del carico integrati, del servizio di monitoraggio, dell'implementazione multi-host e di una console grafica. -È possibile utilizzare StrongLoop PM per svolgere le seguenti attività: - -- Creare, creare pacchetti e implementare l'applicazione Node.js su un sistema locale o remoto. -- Visualizzare i profili CPU e accumulare le istantanee per ottimizzare le prestazioni e diagnosticare le perdite di memoria. -- Fare in modo che i processi e i cluster siano per sempre attivi. -- Visualizzare le metriche delle prestazioni sull'applicazione. -- Gestire con facilità le implementazioni multi-host con l'integrazione Nginx. -- Unificare più StrongLoop PM a un runtime di microservizi distribuito gestito dall'Arc. - -È possibile gestire StrongLoop PM utilizzando uno strumento di interfaccia della riga comandi avanzato denominato `slc` oppure uno strumento grafico denominato Arc. Arc è open source, con un supporto professionale fornito da StrongLoop. - -Per ulteriori informazioni, consultare [http://strong-pm.io/](http://strong-pm.io/). - -Documentazione completa: - -- [Operating Node apps (documentazione StrongLoop)](http://docs.strongloop.com/display/SLC) -- [Using StrongLoop Process Manager](http://docs.strongloop.com/display/SLC/Using+Process+Manager). - -### Installazione - -```console -$ [sudo] npm install -g strongloop -``` - -### Utilizzo di base - -```console -$ cd my-app -$ slc start -``` - -Visualizzare lo stato del Process Manager e tutte le applicazioni implementate: - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -Elencare tutte le applicazioni (servizi) sotto la gestione: - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -Arrestare un'applicazione: - -```console -$ slc ctl stop my-app -``` - -Riavviare un'applicazione: - -```console -$ slc ctl restart my-app -``` - -È inoltre possibile effettuare un "avvio a caldo," il quale fornisce ai processi di lavoro un determinato periodo di tempo per chiudere le connessioni e successivamente riavviare l'applicazione corrente: - -```console -$ slc ctl soft-restart my-app -``` - -Per rimuovere un'applicazione dalla gestione: - -```console -$ slc ctl remove my-app -``` - -## PM2 - -PM2 è un process manager di produzione per le applicazioni Node.js, che dispone di un servizio di bilanciamento del carico integrato. PM2 è utile per consentire alle applicazioni di essere sempre attive e consente di ricaricarle senza interruzione, inoltre faciliterà le attività di gestione del sistema comuni. PM2 inoltre consente di gestire la registrazione dell'applicazione, il monitoraggio e il clustering. - -Per ulteriori informazioni, consultare [https://github.com/Unitech/pm2](https://github.com/Unitech/pm2). - -### Installazione - -```console -$ [sudo] npm install pm2 -g -``` - -### Utilizzo di base - -Quando si avvia un'applicazione utilizzando il comando `pm2`, è necessario specificare il percorso dell'applicazione. Tuttavia, quando si arresta, riavvia o si cancella un'applicazione, è possibile specificare solo il nome o l'ID dell'applicazione. - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use the `pm2 show ` command to get more details about an app. -``` - -Quando si avvia un'applicazione utilizzando il comando `pm2`, l'applicazione viene immediatamente inviata all'applicazione di background. È possibile controllare l'applicazione di background dalla riga comandi utilizzando diversi comandi `pm2`. - -Dopo che un'applicazione viene avviata tramite il comando `pm2`, viene registrata nell'elenco di processi PM2 con un ID. È possibile quindi gestire le applicazioni con lo stesso nome da directory differenti sul sistema, utilizzando i relativi ID. - -Notare che se più di un'applicazione è in esecuzione con lo stesso nome, i comandi `pm2` saranno relativi a tutte quelle applicazioni. Pertanto, si consiglia di utilizzare gli ID invece dei nomi per gestire applicazioni individuali. - -Elencare tutti i processi in esecuzione: - -```console -$ pm2 list -``` - -Arrestare un'applicazione: - -```console -$ pm2 stop 0 -``` - -Riavviare un'applicazione: - -```console -$ pm2 restart 0 -``` - -Per visualizzare informazioni dettagliate su un'applicazione: - -```console -$ pm2 show 0 -``` - -Per rimuovere un'applicazione dal registro di PM2: - -```console -$ pm2 delete 0 -``` - - -## Forever - -Forever è uno strumento di interfaccia della riga comandi semplice che assicura che uno script fornito sia in esecuzione continua (forever). L'interfaccia semplice Forever è ideale per l'esecuzione di piccole distribuzioni degli script e applicazioni di Node.js. - -Per ulteriori informazioni, consultare [https://github.com/foreverjs/forever](https://github.com/foreverjs/forever). - -### Installazione - -```console -$ [sudo] npm install forever -g -``` - -### Utilizzo di base - -Per avviare uno script, utilizzare il comando `forever start` e specificare il percorso dello script: - -```console -$ forever start script.js -``` - -Questo comando consentirà l'esecuzione dello script in modalità daemon (in background). - -Per eseguire lo script in modo tale che sia visualizzato sul terminale, omettere `start`: - -```console -$ forever script.js -``` - -Si consiglia di registrare l'output dallo strumento Forever e lo script utilizzando le opzioni di registrazione `-l`, `-o` e `-e`, come mostrato nel seguente esempio: - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -Per visualizzare l'elenco di script avviati da Forever: - -```console -$ forever list -``` - -Per arrestare uno script che era stato avviato da Forever, utilizzare il comando `forever stop` e specificare l'indice del processo (come elencato dal comando `forever list`). - -```console -$ forever stop 1 -``` - -In alternativa, specificare il percorso del file: - -```console -$ forever stop script.js -``` - -Per arrestare tutti gli script avviati da Forever: - -```console -$ forever stopall -``` - -Forever dispone di molte più opzioni e fornisce inoltre un'API programmatica. diff --git a/it/resources/learning.md b/it/resources/learning.md deleted file mode 100755 index d7b1afcbdb..0000000000 --- a/it/resources/learning.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -layout: page -title: Apprendimento aggiuntivo -menu: resources -lang: it ---- - -# Apprendimento aggiuntivo - -
    Disclaimer: Unendorsed community content.
    - -## Books - -Here are a few of the many books on Express: - - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, early 2015. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) -- [Node-tricks Blog: Express category](http://node-tricks.com/category/express/) - -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings. diff --git a/ja/advanced/best-practice-performance.md b/ja/advanced/best-practice-performance.md index be3912da07..d752dfd7ed 100755 --- a/ja/advanced/best-practice-performance.md +++ b/ja/advanced/best-practice-performance.md @@ -228,7 +228,7 @@ Node 向けの最も一般的なプロセス・マネージャーは次のとお * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -3 つのプロセス・マネージャーの各機能の比較については、[http://strong-pm.io/compare/](http://strong-pm.io/compare/) を参照してください。3 つすべての詳細な紹介については、[Express アプリケーション用のプロセス・マネージャー](/{{ page.lang }}/advanced/pm.html) を参照してください。 +3 つのプロセス・マネージャーの各機能の比較については、[http://strong-pm.io/compare/](http://strong-pm.io/compare/) を参照してください。 これらのプロセス・マネージャーのいずれかを使用すれば、時々異常終了してもアプリケーションの稼働状態を維持するのに十分です。 diff --git a/ja/advanced/pm.md b/ja/advanced/pm.md deleted file mode 100755 index 74ea4d8eed..0000000000 --- a/ja/advanced/pm.md +++ /dev/null @@ -1,292 +0,0 @@ ---- -layout: page -title: Express アプリケーション用のプロセス・マネージャー -menu: advanced -lang: ja ---- - -# Express アプリケーション用のプロセス・マネージャー - -Express アプリケーションを実動で実行する際、以下のタスクを実行するために*プロセス・マネージャー* を使用すると便利です。 - -- アプリケーションが異常終了した場合に自動的に再始動する。 -- ランタイム・パフォーマンスとリソース使用量に関するインサイトを得る。 -- パフォーマンスを向上させるために設定を動的に変更する。 -- クラスタリングを制御する。 - -プロセス・マネージャーは、アプリケーション・サーバーに似ていて、デプロイメントを容易に行えるようにして、高可用性を実現し、アプリケーションを実行時に管理できるようにする、アプリケーションの「コンテナー」です。 - -Express およびその他の Node.js アプリケーション用の最も一般的なプロセス・マネージャーは次のとおりです。 - -- [Forever](#forever) -- [PM2](#pm2) -- [StrongLoop Process Manager](#strongloop-process-manager) -- [SystemD](#systemd) - - -上記の 4 つのツールのいずれを使用しても非常に役立ちますが、StrongLoop Process Manager は、Node.js アプリケーションのライフサイクル全体に対応した包括的な実行時とデプロイメントのソリューションを提供する唯一のツールであり、実動前と実動後のすべてのステップに関するツールを統合インターフェースで提供します。 - -以下に、これらの各ツールについて簡単に説明します。 -詳細な比較については、[http://strong-pm.io/compare/](http://strong-pm.io/compare/) を参照してください。 - -## Forever - -Forever は、特定のスクリプトが確実に継続的 (永続的) に実行されるようにするための単純なコマンド・ライン・インターフェース・ツールです。Forever のインターフェースは単純であるため、Node.js アプリケーションおよびスクリプトの小規模なデプロイメントを実行するのに理想的です。 - -詳細については、[https://github.com/foreverjs/forever](https://github.com/foreverjs/forever) を参照してください。 - -### インストール - -```console -$ [sudo] npm install forever -g -``` - -### 基本的な使用法 - -スクリプトを開始するには、次のように `forever start` コマンドを使用して、スクリプトのパスを指定します。 - -```console -$ forever start script.js -``` - -このコマンドは、スクリプトをデーモン・モード (バックグラウンド) で実行します。 - -端末に接続されるようにスクリプトを実行するには、次のように `start` を省略します。 - -```console -$ forever script.js -``` - -次の例に示すように、ロギング・オプション `-l`、`-o`、および `-e` を使用して Forever ツールおよびスクリプトの出力をログに記録することをお勧めします。 - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -Forever によって開始されたスクリプトのリストを表示するには、次のようにします。 - -```console -$ forever list -``` - -Forever によって開始されたスクリプトを停止するには、`forever stop` コマンドを使用して、プロセス索引 (`forever list` コマンドによってリストされます) を指定します。 - -```console -$ forever stop 1 -``` - -あるいは、次のようにファイルのパスを指定します。 - -```console -$ forever stop script.js -``` - -Forever によって開始されたすべてのスクリプトを停止するには、次のようにします。 - -```console -$ forever stopall -``` - -Forever には、さらに多くのオプションがあり、プログラマチック API もあります。 - -## PM2 - -PM2 は、ロード・バランサーが組み込まれた、Node.js アプリケーション用の実動プロセス・マネージャーです。PM2 では、アプリケーションの稼働を永続的に維持して、ダウン時間を発生させずに再ロードすることができ、共通のシステム管理タスクを簡単に実行できます。PM2 では、アプリケーションのロギング、モニター、クラスタリングを管理することもできます。 - -詳細については、[https://github.com/Unitech/pm2](https://github.com/Unitech/pm2) を参照してください。 - -### インストール - -```console -$ [sudo] npm install pm2 -g -``` - -### 基本的な使用法 - -`pm2` コマンドを使用してアプリケーションを開始する場合、アプリケーションのパスを指定する必要があります。ただし、アプリケーションの停止、再始動、または削除を行う場合は、アプリケーションの名前または ID を指定するだけで済みます。 - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use the `pm2 show ` command to get more details about an app. -``` - -`pm2` コマンドを使用してアプリケーションを開始する場合、アプリケーションは即時にバックグラウンドに送信されます。さまざまな `pm2` コマンドを使用して、コマンド・ラインからバックグラウンド・アプリケーションを制御できます。 - -`pm2` コマンドを使用してアプリケーションが開始された後、アプリケーションはID を使用して PM2 のプロセス・リストに登録されます。そのため、システム上の別のディレクトリーからID を使用して同じ名前を持つアプリケーションを管理できます。 - -同じ名前を持つ複数のアプリケーションが実行されている場合、`pm2` コマンドがすべてのアプリケーションに影響を与えることに注意してください。そのため、個々のアプリケーションを管理するには、名前ではなく ID を使用してください。 - -実行中のプロセスをすべてリストするには、次のようにします。 - -```console -$ pm2 list -``` - -アプリケーションを停止するには、次のようにします。 - -```console -$ pm2 stop 0 -``` - -アプリケーションを再始動するには、次のようにします。 - -```console -$ pm2 restart 0 -``` - -アプリケーションに関する詳細情報を表示するには、次のようにします。 - -```console -$ pm2 show 0 -``` - -アプリケーションを PM2 のレジストリーから削除するには、次のようにします。 - -```console -$ pm2 delete 0 -``` - -## StrongLoop Process Manager - -StrongLoop Process Manager (StrongLoop PM) は、Node.js アプリケーション用の実動プロセス・マネージャーです。StrongLoop PM には、ロード・バランシング、モニター、マルチホスト・デプロイメント、およびグラフィカル・コンソールが組み込まれています。 -StrongLoop PM は、以下のタスクに使用できます。 - -- Node.js アプリケーションを作成してパッケージし、ローカル・システムまたはリモート・システムにデプロイする。 -- CPU プロファイルとヒープ・スナップショットを表示して、パフォーマンスを最適化し、メモリー・リークを診断する。 -- プロセスとクラスターの稼働を永続的に維持する。 -- アプリケーションのパフォーマンス・メトリックを表示する。 -- Nginx が統合されたマルチホスト・デプロイメントを容易に管理する。 -- 複数の StrongLoop PM を、Arc から管理される分散マイクロサービス・ランタイムに統合する。 - -StrongLoop PM で作業するには、`slc` という強力なコマンド・ライン・インターフェース、または Arc というグラフィカル・ツールを使用します。Arc は、オープン・ソースであり、StrongLoop によって専門的なサポートが提供されます。 - -詳細については、[http://strong-pm.io/](http://strong-pm.io/) を参照してください。 - -詳細な説明: - -- [Operating Node apps (StrongLoop 資料)](http://docs.strongloop.com/display/SLC) -- [Using StrongLoop Process Manager](http://docs.strongloop.com/display/SLC/Using+Process+Manager). - -### インストール -```console -$ [sudo] npm install -g strongloop -``` - -### 基本的な使用法 -```console -$ cd my-app -$ slc start -``` - -プロセス・マネージャーとすべてのデプロイ済みアプリケーションを表示するには、次のようにします。 - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -すべての管理対象アプリケーション (サービス) をリストするには、次のようにします。 - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -アプリケーションを停止するには、次のようにします。 - -```console -$ slc ctl stop my-app -``` - -アプリケーションを再始動するには、次のようにします。 - -```console -$ slc ctl restart my-app -``` - -「ソフト再始動」も実行できます。実行するとワーカー・プロセスに既存の接続をクローズするための猶予期間を与えた後で、現行のアプリケーションが再始動されます。 - -```console -$ slc ctl soft-restart my-app -``` - -アプリケーションを管理対象から削除するには、次のようにします。 - -```console -$ slc ctl remove my-app -``` -## SystemD - -### イントロダクション - -SystemDは現代のLinuxディストリビューションにおける、デフォルトのプロセスマネージャです。SystemDに基づいたノードサービスの実行は非常に簡単です。注:このセクションは、[Ralph Slooten(@axllent) のブログ記事](https://www.axllent.org/docs/view/nodejs-service-with-systemd/)に基づいています。 - -### serviceのセットアップ - -Create a file in `/etc/systemd/system/express.service`: - -```sh -[Unit] -Description=Express -# Set dependencies to other services (optional) -#After=mongodb.service - -[Service] -# Run Grunt before starting the server (optional) -#ExecStartPre=/usr/bin/grunt - -# Start the js-file starting the express server -ExecStart=/usr/bin/node server.js -WorkingDirectory=/usr/local/express -Restart=always -RestartSec=10 -StandardOutput=syslog -StandardError=syslog -SyslogIdentifier=Express -# Change to a non-root user (optional, but recommended) -#User= -#Group= -# Set environment options -Environment=NODE_ENV=production PORT=8080 - -[Install] -WantedBy=multi-user.target -``` - -### serviceの有効化 - -```console -$ systemctl enable express.service -``` - -### serviceの起動 - -```console -$ systemctl start express.service -``` - -### serviceのステータスのチェック - -```console -$ systemctl status express.service -``` diff --git a/ja/resources/learning.md b/ja/resources/learning.md deleted file mode 100755 index ccb165dda4..0000000000 --- a/ja/resources/learning.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -layout: page -title: 追加学習 -menu: resources -lang: ja ---- - -# 追加学習 - -
    Disclaimer: Unendorsed community content.
    - -## Books - -Here are a few of the many books on Express: - - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, early 2015. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) -- [Node-tricks Blog: Express category](http://node-tricks.com/category/express/) - -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings. diff --git a/ko/advanced/best-practice-performance.md b/ko/advanced/best-practice-performance.md index e842494f8c..450ceb9451 100755 --- a/ko/advanced/best-practice-performance.md +++ b/ko/advanced/best-practice-performance.md @@ -251,7 +251,7 @@ StrongLoop Process Manager를 이용하는 경우에는 [StrongLoop PM을 서비 * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -위 세 개의 프로세스 관리자에 대한 기능별 비교를 확인하려면 [http://strong-pm.io/compare/](http://strong-pm.io/compare/)를 참조하십시오. 세 프로세스 관리자 모두에 대한 자세한 내용은 [Express 앱용 프로세스 관리자](/{{ page.lang }}/advanced/pm.html)를 참조하십시오. +위 세 개의 프로세스 관리자에 대한 기능별 비교를 확인하려면 [http://strong-pm.io/compare/](http://strong-pm.io/compare/)를 참조하십시오. 이러한 프로세스 관리자 중 어느 하나를 사용하면, 때때로 앱에서 충돌이 발생하는 경우에도, 충분히 앱이 지속적으로 작동하도록 할 수 있습니다. diff --git a/ko/advanced/healthcheck-graceful-shutdown.md b/ko/advanced/healthcheck-graceful-shutdown.md index 6bc4cc2760..afeabdd546 100644 --- a/ko/advanced/healthcheck-graceful-shutdown.md +++ b/ko/advanced/healthcheck-graceful-shutdown.md @@ -9,7 +9,7 @@ lang: ko ## 정상 종료 -애플리케이션의 새 버전을 배포할 때, 이전 버전을 교체해야 합니다. 여러분이 사용하는 [프로세스 매니저](pm.html)는 애플리케어션에 SIGTERM 신호를 보내 종료를 통보할 것입니다. 애플리케이션이 신호를 받으면, 신규 요청을 받는걸 중단하고, 진행중인 요청을 끝내고, DB 연결이나 파일 사용을 포함한 사용한 리소스를 정리할 것입니다. +애플리케이션의 새 버전을 배포할 때, 이전 버전을 교체해야 합니다. 여러분이 사용하는 프로세스 매니저 는 애플리케어션에 SIGTERM 신호를 보내 종료를 통보할 것입니다. 애플리케이션이 신호를 받으면, 신규 요청을 받는걸 중단하고, 진행중인 요청을 끝내고, DB 연결이나 파일 사용을 포함한 사용한 리소스를 정리할 것입니다. ## 상태 확인 @@ -19,89 +19,3 @@ A load balancer uses health checks to determine if an application instance is he * `liveness`: 언제 컨테이너를 재시작할지 결정합니다. * `readiness`: 컨테이너가 트래픽을 받기 시작할 준비가 되었는지 결정합니다. 컨테이너가 준비되지 않았다면, 서비스 로드 밸런서들에게서 제거됩니다. -## 서드 파티 솔루션 - -{% include community-caveat.html %} - -### Terminus - -[Terminus](https://github.com/godaddy/terminus)는 상용구 코드를 쓸 필요를 제거하기 위해 상태 확인 절차와 정상 종료를 추가하는 오픈소스 프로젝트입니다. 먼저 정상 종료를 위한 자원 청소 로직과 상태 확인 로직만 제공하면 됩니다. 그러면 Terminus가 나머지를 처리할겁니다. - -아래 명령을 사용해 Terminus를 설치합니다. - -```console -$ npm i @godaddy/terminus --save -``` - -다음은 Terminus를 사용하는 쉬운 예제입니다. 자세한 정보는 를 참고하세요. - -```js -const http = require('http') -const express = require('express') -const terminus = require('@godaddy/terminus') - -const app = express() - -app.get('/', (req, res) => { - res.send('ok') -}) - -const server = http.createServer(app) - -function onSignal () { - console.log('server is starting cleanup') - // start cleanup of resource, like databases or file descriptors -} - -async function onHealthCheck () { - // checks if the system is healthy, like the db connection is live - // resolves, if health, rejects if not -} - -terminus(server, { - signal: 'SIGINT', - healthChecks: { - '/healthcheck': onHealthCheck - }, - onSignal -}) - -server.listen(3000) -``` - -### Lightship - -[Lightship](https://github.com/gajus/lightship)은 애플리케이션에 상태, 준비, 생존 확인을 추가하는 오픈소스 프로젝트입니다. Lightship은 스탠드얼론 HTTP 서비스로 분리된 HTTP 서비스를 구동합니다. 이를 통해 확인 절차들을 공개적으로 노출시키지 않고 할 수 있게 해줍니다. - -아래 명령을 사용해 Lightship을 설치합니다. - -```console -$ npm install lightship -``` - -Lightship을 사용하는 쉬운 예제입니다. - -```js -const http = require('http') -const express = require('express') -const { - createLightship -} = require('lightship') - -// Lightship will start a HTTP service on port 9000. -const lightship = createLightship() - -const app = express() - -app.get('/', (req, res) => { - res.send('ok') -}) - -app.listen(3000, () => { - lightship.signalReady() -}) - -// You can signal that the service is not ready using `lightship.signalNotReady()`. -``` - -[Lightship 문서](https://github.com/gajus/lightship)에서 [Kubernetes 설정](https://github.com/gajus/lightship#lightship-usage-kubernetes-container-probe-configuration)에 대한 예시와 [Express.js](https://github.com/gajus/lightship#using-with-expressjs)와의 통합 절차에 대한 완전한 예시를 제공합니다. diff --git a/ko/advanced/pm.md b/ko/advanced/pm.md deleted file mode 100755 index eb6808e934..0000000000 --- a/ko/advanced/pm.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -layout: page -title: Express 앱용 프로세스 관리자 -menu: advanced -lang: ko ---- - -# Express 앱용 프로세스 관리자 - -{% include community-caveat.html %} - -프로덕션 환경을 위한 Express를 실행할 때 *프로세스 관리자*를 사용하면 다음과 같은 태스크를 달성하는 데 도움이 됩니다. - -- 앱에서 충돌이 발생할 경우 앱을 자동으로 다시 시작. -- 런타임 성능 및 자원 소비에 대한 통찰력을 획득. -- 성능 향상을 위해 설정을 동적으로 수정. -- 클러스터링을 제어. - -프로세스 관리자는 애플리케이션 서버와 약간 비슷합니다. 프로세스 관리자는 애플리케이션을 위한 "컨테이너"이며, 배치 작업을 용이하게 하고, -높은 가용성을 제공하고, 런타임 시에 애플리케이션을 관리할 수 있도록 합니다. - -가장 널리 사용되는 Express 및 기타 Node.js 애플리케이션용 프로세스 관리자는 다음과 같습니다. - - -- **[Forever](https://github.com/foreverjs/forever){: target="_blank"}**: 주어진 스크립트가 지속적으로(영원히) 실행되도록 하는 간단한 명령행 인터페이스 도구입니다. Forever는 간단한 인터페이스를 갖추고 있으므로 소규모 배치의 Node.js 앱 및 스크립트를 실행하는 데 가장 적합합니다. -- **[PM2](https://github.com/Unitech/pm2){: target="_blank"}**: Node.js 애플리케이션용 프로덕션 프로세스 관리자이며, 여기에는 기본 제공 로드 밸런서가 포함되어 있습니다. PM2를 이용하면 앱을 항상 작동 상태로 유지하고, 시스템 가동 중단 없이 앱을 다시 로드할 수 있으며, 일반적인 시스템 관리 태스크를 쉽게 처리할 수 있습니다. 또한 PM2를 이용하면 애플리케이션 로깅, 모니터링 및 클러스터링을 관리할 수 있습니다. -- **[StrongLoop Process Manager (Strong-PM)](http://strong-pm.io/)**: Node.js 애플리케이션용 프로덕션 프로세스 관리자입니다. 기본 제공 로드 밸런싱, 모니터링, 멀티호스트 배치 및 그래픽 콘솔을 제공합니다. 로컬이나 리모트 시스템에 Node.js 애플리케이션을 빌드, 패키징, 배포하기 위한 CLI를 포함하고 있습니다. -- **SystemD**: 모던 리눅스 배포판의 기본 프로세스 매니저입니다. Node.js 애플리케이션을 서비스로 돌리기 간단하게 만들어 줍니다. 추가 정보는 다음을 참고하세요. ["Run node.js service with systemd" by Ralph Slooten (@axllent)](https://www.axllent.org/docs/view/nodejs-service-with-systemd/) diff --git a/ko/index.md b/ko/index.md index bbd36d7ff5..bedbb23c5c 100644 --- a/ko/index.md +++ b/ko/index.md @@ -37,7 +37,6 @@ lang: ko
    -

    Frameworks

    많은 유명한 프레임워크들이 Express를 기반으로 하고 있습니다.
    diff --git a/ko/resources/learning.md b/ko/resources/learning.md deleted file mode 100755 index bf6e24c57f..0000000000 --- a/ko/resources/learning.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -layout: page -title: 추가 학습 -menu: resources -lang: ko ---- - -# 추가 학습 - -
    Disclaimer: Unendorsed community content.
    - -## Books - -Here are a few of the many books on Express: - - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, early 2015. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) - -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings. diff --git a/pt-br/advanced/best-practice-performance.md b/pt-br/advanced/best-practice-performance.md index edbe4dd6af..32a7eab16a 100755 --- a/pt-br/advanced/best-practice-performance.md +++ b/pt-br/advanced/best-practice-performance.md @@ -334,9 +334,7 @@ seguintes: * [Forever](https://www.npmjs.com/package/forever) Para uma comparação recurso por recurso dos três gerenciadores -de processos, consulte [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Para -obter uma introdução mais detalhada para todos os três, consulte [Gerenciadores de Processos para aplicativos do -Express](/{{ page.lang }}/advanced/pm.html). +de processos, consulte [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Usando qualquer um desses gerenciadores de processos será o suficiente para manter seu aplicativo funcionando, mesmo se ele cair diff --git a/pt-br/advanced/pm.md b/pt-br/advanced/pm.md deleted file mode 100755 index f6fda0e26c..0000000000 --- a/pt-br/advanced/pm.md +++ /dev/null @@ -1,287 +0,0 @@ ---- -layout: page -title: Gerenciadores de processos para aplicativos do Express -menu: advanced -lang: pt-br ---- - -# Gerenciadores de processos para aplicativos do Express - -Ao executar aplicativos do Express para produção, é útil usar um *gerenciador de processos* para completar as -seguintes tarefas: - - -- Reiniciar o aplicativo automaticamente se cair. -- Ganhe insights sobre o desempenho em tempo de execução e o consumo de recursos. - -- Modifique configurações dinamicamente para melhorar o desempenho. -- Controle a clusterização. - -Um gerenciador de processos é de certa forma parecido com um -servidor de aplicativos: ele é um "contêiner" para aplicativos que -facilita a implementação, fornece alta disponibilidade, e permite o -gerenciamento do aplicativo em tempo real. - -Os gerenciadores de processos mais populares para o Express e outros aplicativos Node.js são os seguintes: - -- [StrongLoop Process Manager](#sl) -- [PM2](#pm2) -- [Forever](#forever) - - -Usar qualquer uma dessas três ferramentas pode ser muito útil, -entretanto o StrongLoop Process Manager é a única ferramenta que -fornece uma solução abrangente de tempo de execução e implementação -que é atende ao ciclo de vida completo de aplicativos do Node.js, com -ferramentas para todas as etapas antes e depois da produção, em uma -interface unificada. - - -Aqui está uma breve visão de cada uma dessas ferramentas. -Para obter uma comparação detalhada, consulte [http://strong-pm.io/compare/](http://strong-pm.io/compare/). - -## StrongLoop Process Manager - -O StrongLoop Process Manager (StrongLoop PM) é um gerenciador -de processos para aplicativos do Node.js. O StrongLoop PM possui -balanceamento de carga, monitoramento, e implementação em múltiplos -hosts integrada, e um console gráfico. -É possível usar o StrongLoop PM para as seguintes tarefas: - -- Construir, empacotar, e implementar aplicativos do Node.js para um sistema local ou remoto. -- Visualizar perfis de CPU e captura instantânea de heap para -otimizar o desempenho e diagnosticar fugas de memória. -- Manter processos e clusters ativos para sempre. -- Visualizar métricas de desempenho no seu aplicativo. -- Facilmente gerenciar implementações em múltiplos hosts com a integração com o Nginx. -- Unificar vários StrongLoop PMs para um tempo de execução de microsserviços distribuído que é gerenciado a partir de um Arc. - - -É possível trabalhar com o StrongLoop PM usando uma poderosa -ferramenta de interface da linha de comandos chamada -`slc`, ou uma ferramenta gráfica chamada Arc. A Arc -é um software livre, com suporte profissional fornecido pelo StrongLoop. - -Para obter mais informações, consulte [http://strong-pm.io/](http://strong-pm.io/). - -Documentação completa: - -- [Aplicativos operacionais do Node (documentação do StrongLoop)](http://docs.strongloop.com/display/SLC) -- [Usando o StrongLoop Process Manager](http://docs.strongloop.com/display/SLC/Using+Process+Manager). - -### Instalação - -```console -$ [sudo] npm install -g strongloop -``` - -### Uso Básico - -```console -$ cd my-app -$ slc start -``` - -Visualizar o status do Gerenciador de Processos e todos os aplicativos implementados: - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -Listar todos os aplicativos (serviços) sendo gerenciados: - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -Parar um aplicativo: - -```console -$ slc ctl stop my-app -``` - -Reiniciar um aplicativo: - -```console -$ slc ctl restart my-app -``` - -É possível também fazer uma "reinicialização leve," que dá aos -processos de trabalho um período de tolerância para fechar conexões -existentes, e em seguida reiniciar o aplicativo atual: - - -```console -$ slc ctl soft-restart my-app -``` - -Para remover um aplicativo do gerenciamento: - -```console -$ slc ctl remove my-app -``` - -## PM2 - -O PM2 é um gerenciador de processos de produção para aplicativos do Node.js, -que possui um balanceador de carga integrado. O PM2 permite manter os -aplicativos ativos para sempre e recarregá-los sem tempo de -inatividade, e facilitará tarefas comuns de administração de -sistemas. O PM2 também permite que você gerencie o registro de logs, -o monitoramento, e a clusterização do aplicativo. - - -Para obter mais informações, consulte: [https://github.com/Unitech/pm2](https://github.com/Unitech/pm2). - -### Instalação - -```console -$ [sudo] npm install pm2 -g -``` - -### Uso Básico - -Ao iniciar um aplicativo usando o comando -`pm2`, você deve especificar o caminho do aplicativo. No -entanto, ao parar, reiniciar, ou excluir um aplicativo, é possível -especificar apenas o nome ou o id do aplicativo. - - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use the `pm2 show ` command to get more details about an app. -``` - -Ao iniciar um aplicativo usando o comando `pm2`, o aplicativo será imediatamente enviado para -o segundo plano. É possível controlar os aplicativos em segundo plano a partir da linha de comandos usando vários comandos `pm2`. - -Após um aplicativo ser iniciado usando o comando `pm2`, ele é registrado na lista de -processos do PM2 com um ID. É possível portanto gerenciar aplicativos com o mesmo nome a partir de diretórios diferentes no sistema, usando -os seus IDs. - -Observe que se mais de um aplicativo com o mesmo nome estiver executando, os comandos do `pm2` afetam todos eles. -Portanto use os IDs ao invés dos nomes para gerenciar aplicativos individualmente. - -Listar todos os processos em execução: - -```console -$ pm2 list -``` - -Parar um aplicativo: - -```console -$ pm2 stop 0 -``` - -Reiniciar um aplicativo: - -```console -$ pm2 restart 0 -``` - -Para visualizar informações detalhadas sobre um aplicativo: - -```console -$ pm2 show 0 -``` - -Para remover um aplicativo do registro do PM2: - -```console -$ pm2 delete 0 -``` - - -## Forever - -Forever é uma ferramenta simples de interface da linha de -comandos para assegurar que um dado script executa continuamente -(para sempre). A interface simples do Forever torna-o ideal para a -execução de implementações menores dos aplicativos e scripts do -Node.js. - - -Para obter mais informações, consulte: [https://github.com/foreverjs/forever](https://github.com/foreverjs/forever). - -### Instalação - -```console -$ [sudo] npm install forever -g -``` - -### Uso Básico - -Para iniciar um script, use o comando `forever start` e especifique o caminho do script: - -```console -$ forever start script.js -``` - -Este comando irá executar o script em modo daemon (no segundo plano). - -Para executar o script de forma que ele seja anexado ao terminal, omita `start`: - -```console -$ forever script.js -``` - -É uma boa ideia registrar os logs da saída da ferramenta Forever e do script usando as opções de log `-l`, -`-o`, e `-e`, como mostradas nesse exemplo: - - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -Para visualizar a lista de scripts que foram iniciados pelo Forever: - -```console -$ forever list -``` - -Para parar um script que foi iniciado pelo Forever use o -comando `forever stop` e especifique o índice do -processo (conforme listado pelo comando `forever -list`). - -```console -$ forever stop 1 -``` - -Alternativamente, especifique o caminho do arquivo: - -```console -$ forever stop script.js -``` - -Para parar todos os scripts que foram iniciados pelo Forever: - -```console -$ forever stopall -``` - -O Forever possui muitas outras opções, e ele também fornece uma API programática. - diff --git a/pt-br/resources/learning.md b/pt-br/resources/learning.md deleted file mode 100644 index d3aea1a271..0000000000 --- a/pt-br/resources/learning.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -layout: page -title: Aprendizagem adicional -menu: Recursos -lang: pt-br ---- - -# Aprendizagem adicional - -
    Atenção: Este conteúdo não é de responsabilidade da comunidade.
    - -## Livros - -Aqui estão alguns dos vários livros sobre Express: - - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, Manning Publications, early 2015. - - **[Express.js in Action](http://www.manning.com/hahn/)**, Manning Publications, early 2015. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, Packt Publishing, June 2013. - - **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, texxtoor, September 2015. Em Alemão. - - **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, texxtoor, September 2015. Em Alemão. - - **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Adicione seu livro aqui! - -[Edite o arquivo Markdown](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) e adicione um link para o seu livro, então envie um pull request (necessário login no GitHub). Siga o formato da listagem acima. - -## Blogs - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) - -### Adicione seu blog aqui! - -[Edite o arquivo Markdown](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) e adicione um link para o seu blog, então envie um pull request (necessário login no GitHub). Siga o formato da listagem acima. diff --git a/ru/advanced/best-practice-performance.md b/ru/advanced/best-practice-performance.md index 0a26c21664..9d483a63e4 100755 --- a/ru/advanced/best-practice-performance.md +++ b/ru/advanced/best-practice-performance.md @@ -243,7 +243,7 @@ Environment=NODE_ENV=production * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -Сравнение трех диспетчеров процессов по каждой характеристике можно найти в разделе [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Более подробное представление трех диспетчеров приведено в разделе [Диспетчеры процессов для приложений Express](/{{ page.lang }}/advanced/pm.html). +Сравнение трех диспетчеров процессов по каждой характеристике можно найти в разделе [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Наличие любого из этих диспетчеров процессов позволит обеспечить работоспособность приложения даже в случае возможных сбоев. diff --git a/ru/advanced/pm.md b/ru/advanced/pm.md deleted file mode 100755 index 7c0435f077..0000000000 --- a/ru/advanced/pm.md +++ /dev/null @@ -1,239 +0,0 @@ ---- -layout: page -title: Диспетчеры процессов для приложений Express -menu: advanced -lang: ru ---- - -# Диспетчеры процессов для приложений Express - -При запуске приложения Express для рабочей среды использование *диспетчера процессов* позволяет выполнять следующие задачи: - -- Автоматически перезапускать приложение в случае сбоя. -- Получать аналитическую информацию о производительности среды выполнения и потреблении ресурсов. -- Изменять параметры в динамическом режиме в целях повышения производительности. -- Управлять кластеризацией. - -Диспетчер процессов можно сравнить с сервером приложений: это "контейнер" для приложений, обеспечивающий развертывание и высокую готовность и позволяющий управлять приложением в среде выполнения. - -Наиболее популярные диспетчеры процессов для Express и других приложений Node.js перечислены ниже: - -- [StrongLoop Process Manager](#sl) -- [PM2](#pm2) -- [Forever](#forever) - - -Использование любого из этих трех инструментов может быть исключительно полезным, тем не менее StrongLoop Process Manager является единственным инструментом, предоставляющим универсальное решение для среды выполнения и развертывания в течение всего жизненного цикла приложения Node.js и включающим в себя, в виде единого интерфейса, все средства для каждого этапа, как до перехода в рабочий режим, так и в рабочей среде. - -Ниже приводится краткий обзор каждого из этих инструментов. -Подробное сравнение можно найти в разделе [http://strong-pm.io/compare/](http://strong-pm.io/compare/). - -## StrongLoop Process Manager - -StrongLoop Process Manager (StrongLoop PM) - это рабочий диспетчер процессов для приложений Node.js. В StrongLoop PM предусмотрено встроенное распределение нагрузки, мониторинг, развертывание на нескольких хостах и графическая консоль. -С помощью StrongLoop PM можно выполнять следующие задачи: - -- Компоновать, объединять в пакет и развертывать приложение Node.js в локальной или удаленной системе. -- Просматривать профайлы CPU и моментальные снимки кучи в целях оптимизации производительности и диагностирования утечек памяти. -- Поддерживать постоянную активность процессов и кластеров. -- Просматривать показатели производительности приложения. -- Без затруднений управлять развертываниями на нескольких хостах с интеграцией Nginx. -- Объединять несколько диспетчеров StrongLoop PM в распределенную среду выполнения микрослужб, управляемую из Arc. - -Работать с StrongLoop PM можно посредством многофункционального интерфейса командной строки, называемого `slc`, или графического инструмента Arc. Arc имеет открытый исходный код и обеспечен экспертной поддержкой StrongLoop. - -Дополнительная информация содержится на странице [http://strong-pm.io/](http://strong-pm.io/). - -Полная версия документации: - -- [Управляющие приложения Node (Документация StrongLoop)](http://docs.strongloop.com/display/SLC) -- [Использование StrongLoop Process Manager](http://docs.strongloop.com/display/SLC/Using+Process+Manager). - -### Установка - -```console -$ [sudo] npm install -g strongloop -``` - -### Основы использования - -```console -$ cd my-app -$ slc start -``` - -Просмотр состояния диспетчера процессов и всех развернутых приложений: - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -Вывод списка всех приложений (служб), подлежащих управлению: - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -Остановка приложения: - -```console -$ slc ctl stop my-app -``` - -Перезапуск приложения: - -```console -$ slc ctl restart my-app -``` - -Также можно выполнить "мягкий перезапуск", при котором рабочим процессам выделяется определенное время на закрытие существующих соединений, после чего текущее приложение перезапускается: - -```console -$ slc ctl soft-restart my-app -``` - -Удаление приложения из числа подлежащих управлению: - -```console -$ slc ctl remove my-app -``` - -## PM2 - -PM2 - это диспетчер процессов рабочей среды для приложений Node.js, в котором предусмотрен встроенный инструмент распределения нагрузки. PM2 позволяет всегда поддерживать приложения в рабочем состоянии и перезагружать их без простоев, а также обеспечивает выполнение общих задач системного администрирования. PM2 также позволяет управлять ведением протоколов, мониторингом и кластеризацией приложений. - -Дополнительная информация содержится на странице [https://github.com/Unitech/pm2/](https://github.com/Unitech/pm2). - -### Установка - -```console -$ [sudo] npm install pm2 -g -``` - -### Основы использования - -При запуске приложения с помощью команды `pm2` необходимо указать путь к приложению. Тем не менее, при остановке, перезапуске или удалении приложения можно указать только имя или ИД приложения. - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use the `pm2 show ` command to get more details about an app. -``` - -При запуске приложения с помощью команды `pm2` оно немедленно переводится в фоновый режим. Фоновым приложением можно управлять из командной строки с помощью различных команд `pm2`. - -После запуска приложения с помощью команды `pm2` оно регистрируется в списке процессов PM2 с указанием ИД. Затем можно управлять приложениями с тем же именем из различных каталогов в системе, используя только их ИД. - -Обратите внимание на то, что если запущено несколько приложений с одинаковым именем, команды `pm2` применяются ко всем таким приложениям. Поэтому для управления отдельными приложениями используйте не имена, а ИД. - -Список всех запущенных процессов: - -```console -$ pm2 list -``` - -Остановка приложения: - -```console -$ pm2 stop 0 -``` - -Перезапуск приложения: - -```console -$ pm2 restart 0 -``` - -Просмотр подробной информации о приложении: - -```console -$ pm2 show 0 -``` - -Удаление приложения из реестра PM2: - -```console -$ pm2 delete 0 -``` - - -## Forever - -Forever представляет собой простой инструмент интерфейса командной строки, обеспечивающий непрерывное (бесконечное) выполнение определенного сценария. Благодаря простому интерфейсу Forever является идеальным инструментом для выполнения не столь масштабных развертываний приложений и сценариев Node.js. - -Дополнительная информация содержится на странице [https://github.com/foreverjs/forever/](https://github.com/foreverjs/forever). - -### Установка - -```console -$ [sudo] npm install forever -g -``` - -### Основы использования - -Для запуска сценария воспользуйтесь командой `forever start` и укажите путь к сценарию: - -```console -$ forever start script.js -``` - -Эта команда запустит сценарий в режиме демона (в фоновом режиме). - -Для запуска сценария таким образом, чтобы он был соединен с терминалом, не указывайте `start`: - -```console -$ forever script.js -``` - -Целесообразно регистрировать вывод инструмента Forever и сценария в протоколе, используя для этого опции ведения протоколов `-l`, `-o` и `-e`, как показано в примере ниже: - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -Для просмотра списка сценариев, запущенных с помощью Forever: - -```console -$ forever list -``` - -Для остановки сценария, запущенного с помощью Forever, воспользуйтесь командой `forever stop` и укажите индекс процесса (согласно списку, выведенному с помощью команды `forever list`). - -```console -$ forever stop 1 -``` - -В качестве альтернативы, укажите путь к файлу: - -```console -$ forever stop script.js -``` - -Для остановки всех сценариев, запущенных с помощью Forever: - -```console -$ forever stopall -``` - -В Forever предусмотрено множество других опций, и, кроме того, данным инструментом предоставляется программный API. diff --git a/ru/resources/learning.md b/ru/resources/learning.md deleted file mode 100755 index 492c55546f..0000000000 --- a/ru/resources/learning.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -layout: page -title: Дополнительное обучение -menu: resources -lang: ru ---- - -# Дополнительное обучение - -
    Disclaimer: Unendorsed community content.
    - -## Books - -Here are a few of the many books on Express: - - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, early 2015. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) - -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings. diff --git a/sk/advanced/best-practice-performance.md b/sk/advanced/best-practice-performance.md index 2cbddef5ea..93003af08b 100644 --- a/sk/advanced/best-practice-performance.md +++ b/sk/advanced/best-practice-performance.md @@ -248,7 +248,7 @@ Spomedzi správcov procesov pre Node sú najpopulárnejši: * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -Pre detailnejšie porovnanie vlastností si pozrite [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Pre detailnejšie intro si pozrite [Process managers for Express apps](/{{ page.lang }}/advanced/pm.html). +Pre detailnejšie porovnanie vlastností si pozrite [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Použitím hociktorého z týchto správcov procesov zabezpečíte, aby vaša aplikácia zostala "hore" i v prípade občasného pádu. diff --git a/sk/advanced/pm.md b/sk/advanced/pm.md deleted file mode 100644 index eb5f68fa5e..0000000000 --- a/sk/advanced/pm.md +++ /dev/null @@ -1,243 +0,0 @@ ---- -layout: page -title: Použitie správcov procesov pre Express aplikácie -menu: advanced -lang: sk ---- - - -# Použitie správcov procesov pre Express aplikácie - -Ak vaša Express aplikácia pobeží v produkcii, môže byť k dosiahnutiu nasledujúcich úloh vhodné použiť _správcu processov (process manager)_: - -- Reštart aplikácie v prípade pádu. -- Získanie prehľadu o spotrebe zdrojov a výkonnosti aplikácie. -- Dynamická zmena nastavení k zlepšeniu výkonnosti. -- Kontrola nad clustering-om. - -Správca procesov je čiastočne akoby aplikačný server: je to "kontainer" pre aplikácie uľahčujúci ich deployment, -poskytujúci vysokú dostupnosť a umožňujúci správu aplikácie v runtime. - -Najpopulárnejšie s pomedzi správcov procesov pre Express i ostatné Node.js aplikácie patria: - -- [StrongLoop Process Manager](#sl) -- [PM2](#pm2) -- [Forever](#forever) - - -Použitie ktoréhokoľvek z hore spomenutých nástrojov môže byť veľmi nápomocné, avšak StrongLoop Process Manager je jediným nástrojom poskytujúcim obsiahle runtime a deployment riešenie adresujúce celý životný cyklus Node.js aplikácie pomocou nástrojov pre každý krok pred a po nasadení do produkcie a to v jednotnom rozhraní. - -Tu je jednoduchý náhľad na každý z týchto nástrojov. Pre detailnejšie porovnanie sa pozrite na [http://strong-pm.io/compare/](http://strong-pm.io/compare/). - -## StrongLoop Process Manager - -StrongLoop Process Manager (StrongLoop PM) je produkčný správca procesov pre Node.js aplikácie. StrongLoop PM má vstavaný load balancing, monitoring, multi-host deployment a grafickú konzolu. -StrongLoop PM môžete využiť na tieto úlohy: - -- Build, package, a deploy vašej Node.js aplikácie na lokálny alebo remote systém. -- Zobrazenie CPU profilov and heap snapshotov pre optimalizáciu výkonnosti a diagnostiku memory leakov. -- Udržovanie procesov a clusterov vždy nažive. -- Zobrazenie výkonnostných metrík vašej aplikácie. -- Jednoduchá správa multi-host deploymentov s Nginx integráciou. -- Unifikácia viacerých StrongLoop PM do distribuovaného runtime-u mikro servisov spravovateľných pomocou Arc. - -So StrongLoop PM dokážete pracovať pomocou výkonného command-line interface nástroja nazývaného `slc`, prípadne grafického nástroja nazývaného Arc. Arc je open source s profesonálnou podporou od StrongLoop-u. - -Pre viac informácií si pozrite [http://strong-pm.io/](http://strong-pm.io/). - -Celá dokumentácia: - -- [Operating Node apps (StrongLoop documentation)](http://docs.strongloop.com/display/SLC) -- [Using StrongLoop Process Manager](http://docs.strongloop.com/display/SLC/Using+Process+Manager). - -### Inštalácia - -```console -$ [sudo] npm install -g strongloop -``` - -### Základné použitie - -```console -$ cd my-app -$ slc start -``` - -Zobrazenie stavu správcu procesov a všetkých deploynutých aplikácií: - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -Vypísanie zoznamu všetkých aplikácií (servisov) pod správou: - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -Stopnutie aplikácie: - -```console -$ slc ctl stop my-app -``` - -Reštart aplikácie: - -```console -$ slc ctl restart my-app -``` - -Môžete taktiež vykonať "mäkký reštart", ktorý dá worker procesom dostatok času na uzatvorenie existujúcich pripojení a následne reštartuje aplikáciu: - -```console -$ slc ctl soft-restart my-app -``` - -Odstránenie aplikácie zo správy: - -```console -$ slc ctl remove my-app -``` - -## PM2 - -PM2 je produkčný správca procesov pre Node.js aplikácie so vstavaným load balancerom. PM2 dokáže udržať aplikáciu nažive a vykonať jej prípadný reload bez výpadku a umožní vykonávať bežné system admin úlohy. PM2 taktiež umožňuje spravovať logovanie, monitoring a clustering aplikácií. - -Pre viac informácií sa pozrite na [https://github.com/Unitech/pm2](https://github.com/Unitech/pm2). - -### Inštalácia - -```console -$ [sudo] npm install pm2 -g -``` - -### Základné použitie - -Pre naštartovanie aplikácie pomocou `pm2` príkazu musíte špecifikovať cestu k aplikácii. Avšak pre stop, reštart, alebo odstránenie aplikácie zo správy, postačuje špecifikovať len jej názov alebo ID. - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use the `pm2 show ` command to get more details about an app. -``` - -Po naštartovaní aplikácie pomocou `pm2` príkazu sa aplikácia automaticky spustí na backgrounde (pozadí). Background aplikáciu môžete ovládať z príkazového riadka pomocou rozličných `pm2` príkazov. - -Potom, ako je aplikácia naštartovaná pomocou `pm2` príkazu, je zaregistrovaná do zoznamu PM2 procesov pod konkrétnym ID. Preto dokážete spravovať aplikácie s rovnakým názvom z rôznych priečinkov, použitím ich ID. - -Pozn., ak Vám beží viac ako jedna aplikácia s rovnakým názvom, vykonanie `pm2` príkazu ich ovplyvní všetky. Preto pre správu konkrétnej aplikácie používajte namiesto názvu radšej jej ID. - -Vypísanie zoznamu všetkých bežiacich procesov: - -```console -$ pm2 list -``` - -Stopnutie aplikácie: - -```console -$ pm2 stop 0 -``` - -Reštart aplikácie: - -```console -$ pm2 restart 0 -``` - -Pre zobrazenie detailných informácií o aplikácii: - -```console -$ pm2 show 0 -``` - -Odstránenie aplikácie z PM2 registra: - -```console -$ pm2 delete 0 -``` - - -## Forever - -Forever je jednoduchý command-line nástroj slúžiaci na udržanie vášho skriptu nažive. Jednoduché rozhranie nástroja Forever ho robí ideálnym pre správu menších deploymentov Node.js aplikácií a skriptov. - -Pre viac informácií sa pozrite na [https://github.com/foreverjs/forever](https://github.com/foreverjs/forever). - -### Inštalácia - -```console -$ [sudo] npm install forever -g -``` - -### Základné použitie - -Pre naštartovanie použite príkaz `forever start` a špecifikujte cestu k skriptu: - -```console -$ forever start script.js -``` - -Tento príkaz spustí skript v tzv. daemon móde (na pozadí). - -Pre priame spistenie skriptu v termináli vynechajte `start`: - -```console -$ forever script.js -``` - -Je dobrým zvykom logovať výstup z nástroja Forever a skriptu pomocou prepínača `-l`, `-o` a `-e`, ako je uvedené v príklade nižšie: - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -Pre zobrazenie zoznamu skriptov, ktoré boli naštartované pomocou Forever použite: - -```console -$ forever list -``` - -Pre stopnutie skriptu naštartovaného pomocou Forever použite príkaz `forever stop` a špecifikujte index procesu (podľa výpisu z `forever list` príkazu). - -```console -$ forever stop 1 -``` - -Taktiež to môžete vykonať pomocou špecifikovania cesty k skriptu: - -```console -$ forever stop script.js -``` - -Pre stopnutie všetkých skriptov, ktoré boli naštartované pomocou Forever príkazu použite: - -```console -$ forever stopall -``` - -Nástroj Forever má veľa možností a taktiež poskytuje programové API. diff --git a/sk/index.md b/sk/index.md index a9408a844d..208dc2bf3b 100644 --- a/sk/index.md +++ b/sk/index.md @@ -39,7 +39,6 @@ lang: sk
    -

    Frameworky

    Mnohé známe frameworky sú založené na Express-e.
    diff --git a/sk/resources/companies-using-express.md b/sk/resources/companies-using-express.md deleted file mode 100644 index 6cf621bbe1..0000000000 --- a/sk/resources/companies-using-express.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -layout: page -title: Firmy používajúce Express -menu: resources -lang: sk ---- - -# Firmy používajúce Express v produkcii - - - diff --git a/sk/resources/learning.md b/sk/resources/learning.md deleted file mode 100644 index 6cc24a816d..0000000000 --- a/sk/resources/learning.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -layout: page -title: Dodatočné vzdelávanie -menu: resources -lang: sk ---- - - -# Dodatočné vzdelávanie - -
    Upozornenie: Príspevky komunity nepodliehajúce schvalovaniu.
    - -## Knihy - -Tu je zopár z mnohých kníh o Express: - - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, early 2015. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Pridajte vašu knihu! - -[Upravte Markdown súbor](https://github.com/expressjs/expressjs.com/blob/gh-pages/resources/learning.md) a pridajte odkaz na knihu, zašlite pull request (potrebné prihlásenie pomocou GitHub konta). Dodržiavajte formát zavedený v horeuvedenom zozname. - -## Blogy - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) -- [Baboon Blog: Express category](http://www.baboon.ir/tutorials/expressjs/) (Persian language) - -### Pridajte váš blog! - -[Upravte Markdown súbor](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) a pridajte odkaz na váš blog, zašlite pull request (potrebné prihlásenie pomocou GitHub konta). Dodržiavajte formát zavedený v horeuvedenom zozname. diff --git a/th/advanced/best-practice-performance.md b/th/advanced/best-practice-performance.md index cd95ee74a1..b37537c2f6 100644 --- a/th/advanced/best-practice-performance.md +++ b/th/advanced/best-practice-performance.md @@ -228,7 +228,7 @@ The most popular process managers for Node are as follows: * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -For a feature-by-feature comparison of the three process managers, see [http://strong-pm.io/compare/](http://strong-pm.io/compare/). For a more detailed introduction to all three, see [Process managers for Express apps](/{{ page.lang }}/advanced/pm.html). +For a feature-by-feature comparison of the three process managers, see [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Using any of these process managers will suffice to keep your application up, even if it does crash from time to time. diff --git a/th/advanced/pm.md b/th/advanced/pm.md deleted file mode 100755 index f78a93c23c..0000000000 --- a/th/advanced/pm.md +++ /dev/null @@ -1,295 +0,0 @@ ---- -layout: page -title: Process managers for Express apps -menu: advanced -lang: th ---- - -# Process managers for Express apps - -When you run Express apps for production, it is helpful to use a _process manager_ to achieve the following tasks: - -- Restart the app automatically if it crashes. -- Gain insights into runtime performance and resource consumption. -- Modify settings dynamically to improve performance. -- Control clustering. - -A process manager is somewhat like an application server: it's a "container" for applications that facilitates deployment, -provides high availability, and enables you to manage the application at runtime. - -The most popular process managers for Express and other Node.js applications are as follows: - -- [StrongLoop Process Manager](#strongloop-process-manager) -- [PM2](#pm2) -- [Forever](#forever) -- [SystemD](#systemd) - - -Using any of these four tools can be very helpful, however StrongLoop Process Manager is the only tool that provides a comprehensive runtime and deployment solution that addresses the entire Node.js application life cycle, with tooling for every step before and after production, in a unified interface. - -Here's a brief look at each of these tools. -For a detailed comparison, see [http://strong-pm.io/compare/](http://strong-pm.io/compare/). - -## StrongLoop Process Manager - -StrongLoop Process Manager (StrongLoop PM) is a production process manager for Node.js applications. StrongLoop PM has built-in load balancing, monitoring, and multi-host deployment, and a graphical console. -You can use StrongLoop PM for the following tasks: - -- Build, package, and deploy your Node.js application to a local or remote system. -- View CPU profiles and heap snapshots to optimize performance and diagnose memory leaks. -- Keep processes and clusters alive forever. -- View performance metrics on your application. -- Easily manage multi-host deployments with Nginx integration. -- Unify multiple StrongLoop PMs to a distributed microservices runtime that is managed from Arc. - -You can work with StrongLoop PM by using a powerful command-line interface tool called `slc`, or a graphical tool called Arc. Arc is open source, with professional support provided by StrongLoop. - -For more information, see [http://strong-pm.io/](http://strong-pm.io/). - -Full documentation: - -- [Operating Node apps (StrongLoop documentation)](http://docs.strongloop.com/display/SLC) -- [Using StrongLoop Process Manager](http://docs.strongloop.com/display/SLC/Using+Process+Manager). - -### Installation -```console -$ [sudo] npm install -g strongloop -``` - -### Basic use -```console -$ cd my-app -$ slc start -``` - -View the status of Process Manager and all deployed apps: - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -List all the apps (services) under management: - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -Stop an app: - -```console -$ slc ctl stop my-app -``` - -Restart an app: - -```console -$ slc ctl restart my-app -``` - -You can also "soft restart," which gives worker processes a grace period to close existing connections, then restarts the current application: - -```console -$ slc ctl soft-restart my-app -``` - -To remove an app from management: - -```console -$ slc ctl remove my-app -``` - -## PM2 - -PM2 is a production process manager for Node.js applications, that has a built-in load balancer. PM2 allows you to keep applications alive forever and reload them without downtime, and will facilitate common system admin tasks. PM2 also enables you to manage application logging, monitoring, and clustering. - -For more information, see [https://github.com/Unitech/pm2](https://github.com/Unitech/pm2). - -### Installation - -```console -$ [sudo] npm install pm2 -g -``` - -### Basic use - -When you start an app by using the `pm2` command, you must specify the path of the app. However, when you stop, restart, or delete an app, you can specify just the name or the id of the app. - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use the `pm2 show ` command to get more details about an app. -``` - -When you start an app by using the `pm2` command, the app is immediately sent to the background. You can control the background app from the command line by using various `pm2` commands. - -After an app is started by using the `pm2` command, it is registered in PM2's list of processes with an ID. You can therefore manage apps with the same name from different directories on the system, by using their IDs. - -Note that if more than one app with the same name is running, `pm2` commands affect all of them. So use IDs instead of names to manage individual apps. - -List all running processes: - -```console -$ pm2 list -``` - -Stop an app: - -```console -$ pm2 stop 0 -``` - -Restart an app: - -```console -$ pm2 restart 0 -``` - -To view detailed information about an app: - -```console -$ pm2 show 0 -``` - -To remove an app from PM2's registry: - -```console -$ pm2 delete 0 -``` - - -## Forever - -Forever is a simple command-line interface tool for ensuring that a given script runs continuously (forever). Forever's simple interface makes it ideal for running smaller deployments of Node.js apps and scripts. - -For more information, see [https://github.com/foreverjs/forever](https://github.com/foreverjs/forever). - -### Installation - -```console -$ [sudo] npm install forever -g -``` - -### Basic use - -To start a script, use the `forever start` command and specify the path of the script: - -```console -$ forever start script.js -``` - -This command will run the script in daemon mode (in the background). - -To run the script so that it is attached to the terminal, omit `start`: - -```console -$ forever script.js -``` - -It is a good idea to log output from the Forever tool and the script by using the logging options `-l`, `-o`, and `-e`, as shown this example: - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -To view the list of scripts that were started by Forever: - -```console -$ forever list -``` - -To stop a script that was started by Forever use the `forever stop` command and specify the process index (as listed by the `forever list` command). - -```console -$ forever stop 1 -``` - -Alternatively, specify the path of the file: - -```console -$ forever stop script.js -``` - -To stop all the scripts that were started by Forever: - -```console -$ forever stopall -``` - -Forever has many more options, and it also provides a programmatic API. - -## SystemD - -### Introduction - -SystemD is the default process manager on modern Linux distributions. Running a Node service based on SystemD is very simple. NOTE: This section is based on [a blog post by Ralph Slooten (@axllent)](https://www.axllent.org/docs/view/nodejs-service-with-systemd/). - -### Set up the service - -Create a file in `/etc/systemd/system/express.service`: - -``` -[Unit] -Description=Express -# Set dependencies to other services (optional) -#After=mongodb.service - -[Service] -# Run Grunt before starting the server (optional) -#ExecStartPre=/usr/bin/grunt - -# Start the js-file starting the express server -ExecStart=/usr/bin/node server.js -WorkingDirectory=/usr/local/express -Restart=always -RestartSec=10 -StandardOutput=syslog -StandardError=syslog -SyslogIdentifier=Express -# Change to a non-root user (optional, but recommended) -#User= -#Group= -# Set environment options -Environment=NODE_ENV=production PORT=8080 - -[Install] -WantedBy=multi-user.target -``` - -### Enable service - -``` -$ systemctl enable express.service -``` - -### Start service - -``` -$ systemctl start express.service -``` - -### Check service status - -``` -$ systemctl status express.service -``` diff --git a/th/index.md b/th/index.md index 4c2cfb4e86..530672b6f7 100644 --- a/th/index.md +++ b/th/index.md @@ -39,7 +39,6 @@ lang: th
    -

    เฟรมเวอร์ค

    เฟรมเวอร์คยอดนิยมมากยาย ที่มีพื้นฐานจาก Express.
    diff --git a/th/resources/community.md b/th/resources/community.md index 919ad906f0..8d128ef87d 100755 --- a/th/resources/community.md +++ b/th/resources/community.md @@ -55,8 +55,7 @@ in the repository covering everything from API design and authentication to temp ## Other modules Our vibrant community has created a large variety of extensions, -[middleware modules](/{{ page.lang }}/resources/middleware.html) and -[higher-level frameworks](frameworks.html). +[middleware modules](/{{ page.lang }}/resources/middleware.html) and higher-level frameworks. Additionally, the Express community maintains modules in these two GitHub orgs: diff --git a/th/resources/companies-using-express.md b/th/resources/companies-using-express.md deleted file mode 100644 index 7af2fe1eab..0000000000 --- a/th/resources/companies-using-express.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -layout: page -title: Companies using Express -menu: resources -lang: th ---- - -# Companies using Express in production - - diff --git a/th/resources/frameworks.md b/th/resources/frameworks.md deleted file mode 100644 index e996419e53..0000000000 --- a/th/resources/frameworks.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -layout: page -title: Frameworks built on Express -menu: frameworks -lang: th ---- - -# Frameworks built on Express - -Several popular Node.js frameworks are built on Express: - -- **[Feathers](http://feathersjs.com)**: Build prototypes in minutes and production ready real-time apps in days. -- **[ItemsAPI](https://www.itemsapi.com/)**: Search backend for web and mobile applications built on Express and Elasticsearch. -- **[KeystoneJS](http://keystonejs.com/)**: Website and API Application Framework / CMS with an auto-generated React.js Admin UI. -- **[Kraken](http://krakenjs.com/)**: Secure and scalable layer that extends Express by providing structure and convention. -- **[LEAN-STACK](http://lean-stack.io)**: The Pure JavaScript Stack. -- **[LoopBack](http://loopback.io)**: Highly-extensible, open-source Node.js framework for quickly creating dynamic end-to-end REST APIs. -- **[MEAN](http://mean.io/)**: Opinionated fullstack JavaScript framework that simplifies and accelerates web application development. -- **[Sails](http://sailsjs.org/)**: MVC framework for Node.js for building practical, production-ready apps. -- **[Bottr](http://bottr.co/)**: Framework that simplifies building chatbot applications. -- **[Hydra-Express](https://github.com/flywheelsports/fwsp-hydra-express)**: Hydra-Express is a light-weight library which facilitates building Node.js Microservices using ExpressJS. -- **[Blueprint](http://github.com/onehilltech/blueprint)**: Highly-configurable MVC framework for composing production-ready services from reusable components -- **[Locomotive](http://locomotivejs.org/)**: Powerful MVC web framework for Node.js from the maker of Passport.js -- **[graphql-yoga](https://github.com/graphcool/graphql-yoga)**: Fully-featured, yet simple and lightweight GraphQL server diff --git a/th/resources/learning.md b/th/resources/learning.md deleted file mode 100644 index 267f1630f5..0000000000 --- a/th/resources/learning.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -layout: page -title: การเรียนรู้เพิ่มเติม -menu: resources -lang: th ---- - -# การเรียนรู้เพิ่มเติม - -
    Disclaimer: Unendorsed community content.
    - -## Books - -Here are a few of the many books on Express: - -- **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, April 2016. - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Getting MEAN with Mongo, Express, Angular, and Node, Second Edition](http://www.manning.com/sholmes2/)**, -Manning Publications, April 2017. - - **[Pro Express.js: Master Express.js: The Node.js Framework For Your Web Development](http://www.apress.com/9781484200384)**, -Apress, December 2014. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](https://strongloop.com/strongblog/tag_Express.html) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) -- [Node-tricks Blog: Express category](http://node-tricks.com/category/express/) -- [Baboon Blog: Express category](http://www.baboon.ir/tutorials/expressjs/) (Persian language) -- [Techforgeek Blog: Express category](http://techforgeek.com/expressjs/) -- [RoseHosting.com Blog: Express tag](https://www.rosehosting.com/blog/tag/express/) -- [ThisHosting.Rocks: Express tag](https://thishosting.rocks/tag/express-js/) -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings. diff --git a/tr/advanced/best-practice-performance.md b/tr/advanced/best-practice-performance.md index 8ecf4c515c..651e6c3ee4 100644 --- a/tr/advanced/best-practice-performance.md +++ b/tr/advanced/best-practice-performance.md @@ -228,7 +228,7 @@ Node için en popüler süreç yöneticileri aşağıdakilerdir: * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -Bu üç süreç yöneticisinin özellik bazında bir karşılaştırması için bakınız [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Her üçü ile ilgili daha detaylı bir giriş için bakınız [Express uygulamaları için süreç yöneticileri](/{{ page.lang }}/advanced/pm.html). +Bu üç süreç yöneticisinin özellik bazında bir karşılaştırması için bakınız [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Uygulamanız zaman zaman patlasa bile, bu süreç yöneticilerinden birini kullanmanız uygulamanızı ayakta tutmak için yeterli olacaktır. diff --git a/tr/advanced/pm.md b/tr/advanced/pm.md deleted file mode 100644 index b9e484abc1..0000000000 --- a/tr/advanced/pm.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -layout: page -title: Express uygulamaları için Süreç yöneticileri -menu: advanced -lang: tr -redirect_from: "/advanced/pm.html" ---- - -# Express uygulamaları için Süreç yöneticileri - -{% include community-caveat.html %} - -Canlı ortam için Express uygulamaları koştuğunuzda aşağıdaki nedenlerden ötürü bir _süreç yöneticisi_ kullanmak faydalı olacaktır: - -- Uygulama patladığında otomatik olarak tekrar başlatmak. -- Çalışma zamanı performansı ve kaynak tüketimi hakkında daha iyi bilgiler elde edinmek. -- Performansı iyileştirmek için ayarları dinamik olarak değiştirmek. -- Kümelemeyi (clustering) kontrol etmek. - -Süreç yöneticisi, bir nevi bir uygulama sunucusuna benzer: dağıtımı kolaylaştıran, yüksek kullanılabilirlik sağlayan ve uygulamayı çalışma zamanında (runtime) yönetmenizi sağlayan, uygulamalar için bir "kapsayıcı" (container)dır. - -Express ve diğer Node.js uygulamaları için en popüler süreç yöneticileri şunlardır: - -- **[Forever](https://github.com/foreverjs/forever){: target="_blank"}**: Bir komut dosyasının sürekli (sonsuza kadar) çalışmasını sağlamak için basit bir komut satırı arayüzü aracı. Forever'ın basit arayüzü, Node.js uygulamalarının ve komut dosyalarının küçük dağıtımlarını çalıştırmak için idealdir. -- **[PM2](https://github.com/Unitech/pm2){: target="_blank"}**: Gömülü bir yük dengeleyiciye (load balancer) sahip, Node.js uygulamaları için bir canlı ortam süreç yöneticisi. PM2, uygulamaları sonsuza kadar canlı tutmanıza olanak tanır, kesinti olmadan yeniden yükler, loglamayı, izleme (monitoring) ve kümelemeyi yönetmenize yardımcı olur. -- **[StrongLoop Process Manager (Strong-PM)](http://strong-pm.io/)**: Gömülü yük dengeleme (load balancer), izleme (monitoring) ve çoklu dağıtıma özelliklerine sahip, Node.js uygulamaları için bir canlı ortam süreç yöneticisi. Node.js uygulamalarını oluşturmak (build), paketlemek ve yerel (local) veya uzak bir sisteme dağıtmak için bir CLI içerir. -- **SystemD**: Modern Linux dağıtımlarındaki varsayılan süreç yöneticisi, bir Node uygulamasının servis olarak çalıştırılmasını kolaylaştırır. Daha fazla bilgi için bakınız ["Run node.js service with systemd" by Ralph Slooten (@axllent)](https://www.axllent.org/docs/view/nodejs-service-with-systemd/). diff --git a/tr/index.md b/tr/index.md index 4038203677..2a245e4c3c 100644 --- a/tr/index.md +++ b/tr/index.md @@ -37,7 +37,6 @@ lang: tr
    -

    Çatılar

    Birçok popüler çatı Express tabanlıdır.
    diff --git a/tr/resources/community.md b/tr/resources/community.md index cf72db9d33..13f8f6fdac 100644 --- a/tr/resources/community.md +++ b/tr/resources/community.md @@ -55,8 +55,7 @@ in the repository covering everything from API design and authentication to temp ## Other modules Our vibrant community has created a large variety of extensions, -[middleware modules](/{{ page.lang }}/resources/middleware.html) and -[higher-level frameworks](frameworks.html). +[middleware modules](/{{ page.lang }}/resources/middleware.html) and higher-level frameworks. Additionally, the Express community maintains modules in these two GitHub orgs: diff --git a/tr/resources/companies-using-express.md b/tr/resources/companies-using-express.md deleted file mode 100644 index 7bb919db5c..0000000000 --- a/tr/resources/companies-using-express.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -layout: page -title: Companies using Express -menu: resources -lang: tr ---- -
    -# Companies using Express in production - - -
    diff --git a/tr/resources/frameworks.md b/tr/resources/frameworks.md deleted file mode 100644 index ff9b16e1b7..0000000000 --- a/tr/resources/frameworks.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -layout: page -title: Frameworks built on Express -menu: frameworks -lang: tr ---- -
    -# Frameworks built on Express - -Several popular Node.js frameworks are built on Express: - -- **[Feathers](http://feathersjs.com)**: Build prototypes in minutes and production ready real-time apps in days. -- **[ItemsAPI](https://www.itemsapi.com/)**: Search backend for web and mobile applications built on Express and Elasticsearch. -- **[KeystoneJS](http://keystonejs.com/)**: Website and API Application Framework / CMS with an auto-generated React.js Admin UI. -- **[Kraken](http://krakenjs.com/)**: Secure and scalable layer that extends Express by providing structure and convention. -- **[LEAN-STACK](http://lean-stack.io)**: The Pure JavaScript Stack. -- **[LoopBack](http://loopback.io)**: Highly-extensible, open-source Node.js framework for quickly creating dynamic end-to-end REST APIs. -- **[MEAN](http://mean.io/)**: Opinionated fullstack JavaScript framework that simplifies and accelerates web application development. -- **[Sails](http://sailsjs.org/)**: MVC framework for Node.js for building practical, production-ready apps. -- **[Bottr](http://bottr.co/)**: Framework that simplifies building chatbot applications. -- **[Hydra-Express](https://github.com/flywheelsports/fwsp-hydra-express)**: Hydra-Express is a light-weight library which facilitates building Node.js Microservices using ExpressJS. -- **[Blueprint](http://github.com/onehilltech/blueprint)**: Highly-configurable MVC framework for composing production-ready services from reusable components -- **[Locomotive](http://locomotivejs.org/)**: Powerful MVC web framework for Node.js from the maker of Passport.js -
    diff --git a/tr/resources/learning.md b/tr/resources/learning.md deleted file mode 100644 index 544d5e7a33..0000000000 --- a/tr/resources/learning.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -layout: page -title: Ek öğrenme -menu: resources -lang: tr ---- -
    - -# Ek öğrenme - -
    Disclaimer: Unendorsed community content.
    - -## Books - -Here are a few of the many books on Express: - -- **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, April 2016. - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Getting MEAN with Mongo, Express, Angular, and Node, Second Edition](http://www.manning.com/sholmes2/)**, -Manning Publications, April 2017. - - **[Pro Express.js: Master Express.js: The Node.js Framework For Your Web Development](http://www.apress.com/9781484200384)**, -Apress, December 2014. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) -- [Node-tricks Blog: Express category](http://node-tricks.com/category/express/) -- [Baboon Blog: Express category](http://www.baboon.ir/tutorials/expressjs/) (Persian language) -- [Techforgeek Blog: Express category](http://techforgeek.com/expressjs/) -- [RoseHosting.com Blog: Express tag](https://www.rosehosting.com/blog/tag/express/) - -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings. -
    diff --git a/uk/advanced/best-practice-performance.md b/uk/advanced/best-practice-performance.md index f513409119..11045cae7c 100644 --- a/uk/advanced/best-practice-performance.md +++ b/uk/advanced/best-practice-performance.md @@ -239,7 +239,7 @@ The most popular process managers for Node are as follows: * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -For a feature-by-feature comparison of the three process managers, see [http://strong-pm.io/compare/](http://strong-pm.io/compare/). For a more detailed introduction to all three, see [Process managers for Express apps](/{{ page.lang }}/advanced/pm.html). +For a feature-by-feature comparison of the three process managers, see [http://strong-pm.io/compare/](http://strong-pm.io/compare/). Using any of these process managers will suffice to keep your application up, even if it does crash from time to time. diff --git a/uk/advanced/pm.md b/uk/advanced/pm.md deleted file mode 100755 index 8c6871d61a..0000000000 --- a/uk/advanced/pm.md +++ /dev/null @@ -1,240 +0,0 @@ ---- -layout: page -title: Менеджери процесів для Express застосунків -menu: advanced -lang: uk ---- - -# Менеджери процесів для Express застосунків - -When you run Express apps for production, it is helpful to use a _process manager_ to achieve the following tasks: - -- Restart the app automatically if it crashes. -- Gain insights into runtime performance and resource consumption. -- Modify settings dynamically to improve performance. -- Control clustering. - -A process manager is somewhat like an application server: it's a "container" for applications that facilitates deployment, -provides high availability, and enables you to manage the application at runtime. - -The most popular process managers for Express and other Node.js applications are as follows: - -- [StrongLoop Process Manager](#sl) -- [PM2](#pm2) -- [Forever](#forever) - - -Using any of these three tools can be very helpful, however StrongLoop Process Manager is the only tool that provides a comprehensive runtime and deployment solution that addresses the entire Node.js application life cycle, with tooling for every step before and after production, in a unified interface. - -Here's a brief look at each of these tools. -For a detailed comparison, see [http://strong-pm.io/compare/](http://strong-pm.io/compare/). - -## StrongLoop Process Manager - -StrongLoop Process Manager (StrongLoop PM) is a production process manager for Node.js applications. StrongLoop PM has built-in load balancing, monitoring, and multi-host deployment, and a graphical console. -You can use StrongLoop PM for the following tasks: - -- Build, package, and deploy your Node.js application to a local or remote system. -- View CPU profiles and heap snapshots to optimize performance and diagnose memory leaks. -- Keep processes and clusters alive forever. -- View performance metrics on your application. -- Easily manage multi-host deployments with Nginx integration. -- Unify multiple StrongLoop PMs to a distributed microservices runtime that is managed from Arc. - -You can work with StrongLoop PM by using a powerful command-line interface tool called `slc`, or a graphical tool called Arc. Arc is open source, with professional support provided by StrongLoop. - -For more information, see [http://strong-pm.io/](http://strong-pm.io/). - -Full documentation: - -- [Operating Node apps (StrongLoop documentation)](http://docs.strongloop.com/display/SLC) -- [Using StrongLoop Process Manager](http://docs.strongloop.com/display/SLC/Using+Process+Manager). - -### Installation - -```console -$ [sudo] npm install -g strongloop -``` - -### Basic use - -```console -$ cd my-app -$ slc start -``` - -View the status of Process Manager and all deployed apps: - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -List all the apps (services) under management: - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -Stop an app: - -```console -$ slc ctl stop my-app -``` - -Restart an app: - -```console -$ slc ctl restart my-app -``` - -You can also "soft restart," which gives worker processes a grace period to close existing connections, then restarts the current application: - -```console -$ slc ctl soft-restart my-app -``` - -To remove an app from management: - -```console -$ slc ctl remove my-app -``` - -## PM2 - -PM2 is a production process manager for Node.js applications, that has a built-in load balancer. PM2 allows you to keep applications alive forever and reload them without downtime, and will facilitate common system admin tasks. PM2 also enables you to manage application logging, monitoring, and clustering. - -For more information, see [https://github.com/Unitech/pm2](https://github.com/Unitech/pm2). - -### Installation - -```console -$ [sudo] npm install pm2 -g -``` - -### Basic use - -When you start an app by using the `pm2` command, you must specify the path of the app. However, when you stop, restart, or delete an app, you can specify just the name or the id of the app. - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use the `pm2 show ` command to get more details about an app. -``` - -When you start an app by using the `pm2` command, the app is immediately sent to the background. You can control the background app from the command line by using various `pm2` commands. - -After an app is started by using the `pm2` command, it is registered in PM2's list of processes with an ID. You can therefore manage apps with the same name from different directories on the system, by using their IDs. - -Note that if more than one app with the same name is running, `pm2` commands affect all of them. So use IDs instead of names to manage individual apps. - -List all running processes: - -```console -$ pm2 list -``` - -Stop an app: - -```console -$ pm2 stop 0 -``` - -Restart an app: - -```console -$ pm2 restart 0 -``` - -To view detailed information about an app: - -```console -$ pm2 show 0 -``` - -To remove an app from PM2's registry: - -```console -$ pm2 delete 0 -``` - - -## Forever - -Forever is a simple command-line interface tool for ensuring that a given script runs continuously (forever). Forever's simple interface makes it ideal for running smaller deployments of Node.js apps and scripts. - -For more information, see [https://github.com/foreverjs/forever](https://github.com/foreverjs/forever). - -### Installation - -```console -$ [sudo] npm install forever -g -``` - -### Basic use - -To start a script, use the `forever start` command and specify the path of the script: - -```console -$ forever start script.js -``` - -This command will run the script in daemon mode (in the background). - -To run the script so that it is attached to the terminal, omit `start`: - -```console -$ forever script.js -``` - -It is a good idea to log output from the Forever tool and the script by using the logging options `-l`, `-o`, and `-e`, as shown this example: - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -To view the list of scripts that were started by Forever: - -```console -$ forever list -``` - -To stop a script that was started by Forever use the `forever stop` command and specify the process index (as listed by the `forever list` command). - -```console -$ forever stop 1 -``` - -Alternatively, specify the path of the file: - -```console -$ forever stop script.js -``` - -To stop all the scripts that were started by Forever: - -```console -$ forever stopall -``` - -Forever has many more options, and it also provides a programmatic API. diff --git a/uk/index.md b/uk/index.md index 2f35c1f2b4..3533bfcbd8 100644 --- a/uk/index.md +++ b/uk/index.md @@ -35,7 +35,6 @@ lang: uk
    -

    Фреймворки

    Багато популярних фреймворків грунтуються на Express.
    diff --git a/uk/resources/frameworks.md b/uk/resources/frameworks.md deleted file mode 100644 index b0bf786259..0000000000 --- a/uk/resources/frameworks.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -layout: page -title: Фреймворки, що використовують Express -menu: frameworks -lang: uk ---- - -# Фреймворки, що використовують Express - -Several popular Node.js frameworks are built on Express: - -- **[LoopBack](http://loopback.io)**: Highly-extensible, open-source Node.js framework for quickly creating dynamic end-to-end REST APIs. -- **[Sails](http://sailsjs.org/)**: MVC framework for Node.js for building practical, production-ready apps. -- **[Kraken](http://krakenjs.com/)**: Secure and scalable layer that extends Express by providing structure and convention. -- **[MEAN](http://mean.io/)**: Opinionated fullstack JavaScript framework that simplifies and accelerates web application development. diff --git a/uk/resources/learning.md b/uk/resources/learning.md deleted file mode 100644 index 469d443b50..0000000000 --- a/uk/resources/learning.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -layout: page -title: Додаткове навчання -menu: resources -lang: uk ---- - -# Додаткове навчання - -
    Disclaimer: Unendorsed community content.
    - -## Books - -Here are a few of the many books on Express: - - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, early 2015. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) -- [Baboon Blog: Express category](http://www.baboon.ir/tutorials/expressjs/) (Persian language) - -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings. diff --git a/uz/advanced/pm.md b/uz/advanced/pm.md deleted file mode 100644 index 4ef90674f7..0000000000 --- a/uz/advanced/pm.md +++ /dev/null @@ -1,240 +0,0 @@ ---- -layout: page -title: Process managers for Express apps -menu: advanced -lang: uz ---- - -# Process managers for Express apps - -When running Express apps for production, it is helpful to use a _process manager_ to: - -- Restart the app automatically if it crashes. -- Gain insights into runtime performance and resource consumption. -- Modify settings dynamically to improve performance. -- Control clustering. - -A process manager is somewhat like an application server: it's a "container" for applications that facilitates deployment, -provides high availability, and enables you to manage the application at runtime. - -The most popular process managers for Express and other Node applications are: - -- [StrongLoop Process Manager](#sl) -- [PM2](#pm2) -- [Forever](#forever) - - -Using any of these three tools can be very helpful, however StrongLoop Process Manager is the only solution that provides a comprehensive runtime and deployment solution that address entire Node application life cycle with tooling for every step before and after production in an unified interface. - -Here's a brief look at each of these tools. -For a detailed comparison, see [http://strong-pm.io/compare/](http://strong-pm.io/compare/). - -## StrongLoop Process Manager - -StrongLoop Process Manager (StrongLoop PM) is a production process manager for Node.js applications with built-in load balancing, monitoring, multi-host deployment, and a graphical console. -It enables you to: - -- Build, package, and deploy your Node application to a local or remote system. -- View CPU profiles and heap snapshots to optimize performance and diagnose memory leaks. -- Keep processes and clusters alive forever. -- View performance metrics on your application. -- Easily manage multi-host deployments with Nginx integration. -- Unify multiple StrongLoop PMs to a distributed microservices runtime managed from Arc. - -You can work with StrongLoop PM using a powerful CLI tool, `slc`, or a graphical tool, Arc. It's open source, with professional support provided by StrongLoop. - -For more information, see [http://strong-pm.io/](http://strong-pm.io/). - -Full documentation: - -- [Operating Node apps (StrongLoop documentation)](http://docs.strongloop.com/display/SLC) -- [Using StrongLoop Process Manager](http://docs.strongloop.com/display/SLC/Using+Process+Manager). - -### Installation - -```console -$ [sudo] npm install -g strongloop -``` - -### Basic use - -```console -$ cd my-app -$ slc start -``` - -View status of Process Manager and all deployed apps: - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -List all apps (services) under management: - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -Stop an app: - -```console -$ slc ctl stop my-app -``` - -Restart an app: - -```console -$ slc ctl restart my-app -``` - -You can also "soft restart," which gives worker processes a grace period to close existing connections, then restarts the current application: - -```console -$ slc ctl soft-restart my-app -``` - -To remove an app from management: - -```console -$ slc ctl remove my-app -``` - -## PM2 - -PM2 is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and will facilitate common system admin tasks. It also enables you to manage application logging, monitoring, and clustering. - -For more information, see [https://github.com/Unitech/pm2](https://github.com/Unitech/pm2). - -### Installation - -```console -$ [sudo] npm install pm2 -g -``` - -### Basic use - -Starting an app with `pm2` requires the path of the app to be specified. However, stopping, restarting, and deleting requires just the name or the id of the app. - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use `pm2 show ` to get more details about an app -``` - -Starting an app with `pm2` will immediately send it to the background. You can control the background app from the command line using various `pm2` commands. - -Once an app is started with `pm2` it is registered in `pm2`'s list of processes with an ID, which makes it possible to manage apps with the same name from different directories on the system, using their IDs. - -Note that if more than one app with the same name is running, `pm2` commands affect all of them. So use IDs instead of names to manage individual apps. - -List all running processes: - -```console -$ pm2 list -``` - -Stop an app: - -```console -$ pm2 stop 0 -``` - -Restart an app: - -```console -$ pm2 restart 0 -``` - -To view detailed information about an app: - -```console -$ pm2 show 0 -``` - -To remove an app from `pm2`'s registry: - -```console -$ pm2 delete 0 -``` - - -## Forever - -Forever is a simple CLI tool for ensuring that a given script runs continuously (forever). Its simple interface makes it ideal for running smaller deployments of Node apps and scripts. - -For more information, see [https://github.com/foreverjs/forever](https://github.com/foreverjs/forever). - -### Installation - -```console -$ [sudo] npm install forever -g -``` - -### Basic use - -To start a script, use the `forever start` command and specify the path of the script: - -```console -$ forever start script.js -``` - -This will run the script in daemon mode (in the background). - -To run the script attached to the terminal, omit `start`: - -```console -$ forever script.js -``` - -It is a good idea to log output from forever and the script using the logging options `-l`, `-o`, `-e`, as shown this example: - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -To view the list of scripts started by forever: - -```console -$ forever list -``` - -To stop a script started by forever use the `forever stop` command and specify the process index (as listed by the `forever list` command). - -```console -$ forever stop 1 -``` - -Alternatively, specify the path of the file: - -```console -$ forever stop script.js -``` - -To stop all the scripts started by `forever`: - -```console -$ forever stopall -``` - -Forever has many more options, and it also provides a programmatic API. diff --git a/uz/index.md b/uz/index.md index 333fbccbc4..16b04d3c9d 100644 --- a/uz/index.md +++ b/uz/index.md @@ -34,9 +34,8 @@ lang: uz

    Ishlab chiqaruvchanlik

    Express Nodedagi siz bilgan va sevgan imkoniyatlarni cheklamagan holda web-dasturlardagi eng asosiy imkoniyatlar bilan ta'minlab beradi. -
    -

    Freymvorklar

    Express asosida yaratilgan ko'plab mashxur freymvorklar . -
    +
    +
    diff --git a/uz/resources/learning.md b/uz/resources/learning.md deleted file mode 100644 index 8a50660573..0000000000 --- a/uz/resources/learning.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -layout: page -title: Additional learning -menu: resources -lang: uz ---- - -# Additional learning - -
    Disclaimer: Unendorsed community content.
    - -## Books - -Here are a few of the many books on Express: - - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, early 2015. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Pack Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Pack Publishing, June 2013. - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) - -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings. diff --git a/zh-cn/advanced/best-practice-performance.md b/zh-cn/advanced/best-practice-performance.md index 12773b38cf..838af90ec4 100755 --- a/zh-cn/advanced/best-practice-performance.md +++ b/zh-cn/advanced/best-practice-performance.md @@ -235,7 +235,7 @@ Node 的最流行进程管理器包括: * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -要了解对这三种进程管理器的逐个功能的比较,请参阅 [http://strong-pm.io/compare/](http://strong-pm.io/compare/)。有关这所有三种进程管理器的更详细介绍,请参阅 [Express 应用程序的进程管理器](/{{ page.lang }}/advanced/pm.html)。 +要了解对这三种进程管理器的逐个功能的比较,请参阅 [http://strong-pm.io/compare/](http://strong-pm.io/compare/)。 即使应用程序会不时崩溃,使用其中任何进程管理器都足以使其成功启动。 diff --git a/zh-cn/advanced/pm.md b/zh-cn/advanced/pm.md deleted file mode 100755 index 0c4e744392..0000000000 --- a/zh-cn/advanced/pm.md +++ /dev/null @@ -1,239 +0,0 @@ ---- -layout: page -title: Express 应用程序的进程管理器 -menu: advanced -lang: zh-cn ---- - -# Express 应用程序的进程管理器 - -在生产环境中运行 Express 应用程序时,使用*进程管理器*对于完成以下任务很有帮助: - -- 在应用程序崩溃后将其重新启动。 -- 获得对运行时性能和资源消耗的洞察。 -- 动态修改设置以改善性能。 -- 控制集群。 - -进程管理器有点类似于应用程序服务器:它是应用程序的“容器”,可促进部署,提供高可用性并使您可以在运行时管理应用程序。 - -用于 Express 和其他 Node.js 应用程序的最流行的进程管理器包括: - -- [StrongLoop Process Manager](#sl) -- [PM2](#pm2) -- [Forever](#forever) - - -这三种工具都非常有用,但 StrongLoop Process Manager 是提供全面的运行时和部署解决方案的唯一工具,能够满足整个 Node.js 应用程序生命周期的需求,并在统一的界面中为生产前后的每一个步骤提供工具。 - -以下是对每种工具的简介。 -要获取详细的比较,请参阅 [http://strong-pm.io/compare/](http://strong-pm.io/compare/)。 - -## StrongLoop Process Manager - -StrongLoop Process Manager (StrongLoop PM) 是 Node.js 应用程序的生产进程管理器。StrongLoop PM 具有内置负载均衡、监控和多主机部署功能,还有一个图形控制台。 -可将 StrongLoop PM 用于以下任务: - -- 构建、打包 Node.js 应用程序并将其部署到本地或远程系统。 -- 查看 CPU 概要文件和堆快照,以优化性能和诊断内存泄漏。 -- 使进程和集群持久保持运行。 -- 查看应用程序的性能指标。 -- 使用 Nginx 集成轻松管理多主机部署。 -- 将多个 StrongLoop PM 统一到从 Arc 管理的分布式微服务运行时。 - -可以使用称为 `slc` 的强大命令行界面工具或者称为 Arc 的图形工具与 StrongLoop PM 协作。Arc 是开源的,由 StrongLoop 提供专业支持。 - -有关更多信息,请参阅 [http://strong-pm.io/](http://strong-pm.io/)。 - -完整文档: - -- [Operating Node apps](http://docs.strongloop.com/display/SLC)(StrongLoop 文档) -- [Using StrongLoop Process Manager](http://docs.strongloop.com/display/SLC/Using+Process+Manager). - -### 安装 - -```console -$ [sudo] npm install -g strongloop -``` - -### 基本使用 - -```console -$ cd my-app -$ slc start -``` - -查看进程管理器和所有部署的应用程序的状态: - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -列出受到管理的所有应用程序(服务): - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -停止应用程序: - -```console -$ slc ctl stop my-app -``` - -重新启动应用程序: - -```console -$ slc ctl restart my-app -``` - -还可以“软重新启动”,这使工作进程有一个宽限期来关闭现有连接,然后重新启动当前应用程序: - -```console -$ slc ctl soft-restart my-app -``` - -要移除受到管理的应用程序: - -```console -$ slc ctl remove my-app -``` - -## PM2 - -PM2 是 Node.js 应用程序的生产进程管理器,具有内置的负载均衡器。PM2 可以使应用程序保持持久运行,无需宕机即可重新装入,并可以简化常见的系统管理任务。PM2 还使您可以管理应用程序记录、监控和集群。 - -有关更多信息,请参阅 [https://github.com/Unitech/pm2](https://github.com/Unitech/pm2)。 - -### 安装 - -```console -$ [sudo] npm install pm2 -g -``` - -### 基本使用 - -在使用 `pm2` 命令启动应用程序时,必须指定应用程序的路径。但在停止、重新启动或删除应用程序时,只需指定应用程序的名称或标识。 - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use the `pm2 show ` command to get more details about an app. -``` - -使用 `pm2` 命令启动应用程序时,立即将应用程序发送到后台。可以使用各种 `pm2` 命令从命令行控制后台应用程序。 - -在使用 `pm2` 命令启动应用程序之后,会 PM2 的进程列表中使用标识注册该应用程序。因此,可以使用标识来管理系统上不同目录中的同名应用程序。 - -请注意,如果有多个同名的应用程序在运行,那么 `pm2` 命令会影响所有这些应用程序。所以请使用标识而不是名称来管理各个应用程序。 - -列出所有正在运行的进程: - -```console -$ pm2 list -``` - -停止应用程序: - -```console -$ pm2 stop 0 -``` - -重新启动应用程序: - -```console -$ pm2 restart 0 -``` - -要查看关于应用程序的详细信息: - -```console -$ pm2 show 0 -``` - -要从 PM2 的注册表移除应用程序: - -```console -$ pm2 delete 0 -``` - - -## Forever - -Forever 是一种简单的命令行界面工具,用于确保特定脚本持续(永久)运行。Forever 的简单界面使其成为运行 Node.js 应用程序和脚本的较小部署的理想选择。 - -有关更多信息,请参阅 [https://github.com/foreverjs/forever](https://github.com/foreverjs/forever)。 - -### 安装 - -```console -$ [sudo] npm install forever -g -``` - -### 基本使用 - -要启动脚本,请使用 `forever start` 命令并指定脚本的路径: - -```console -$ forever start script.js -``` - -此命令(在后台)以守护程序方式运行脚本。 - -要运行脚本以便其附加到终端,请省略 `start`: - -```console -$ forever script.js -``` - -使用日志记录选项 `-l`、`-o` 和 `-e`(如此示例中所示)记录来自 Forever 工具和脚本的输出,是很好的构想: - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -要查看 Forever 启动的脚本的列表: - -```console -$ forever list -``` - -要停止由 Forever 启动的脚本,请使用 `forever stop` 命令并指定进程索引(如 `forever list` 命令所列出)。 - -```console -$ forever stop 1 -``` - -或者,指定文件的路径: - -```console -$ forever stop script.js -``` - -要停止 Forever 启动的所有脚本: - -```console -$ forever stopall -``` - -Forever 还有许多其他选项,还提供编程 API。 diff --git a/zh-cn/index.md b/zh-cn/index.md index 9750573408..46f942775d 100644 --- a/zh-cn/index.md +++ b/zh-cn/index.md @@ -34,11 +34,6 @@ Express 文档英文以外的语言版本包括:[西班牙语](/es)、[日语]

    性能

    Express 提供精简的基本 Web 应用程序功能,而不会隐藏您了解和青睐的 Node.js 功能。
    - -
    -

    框架

    许多基于 Express 的 流行框架 。 -
    - diff --git a/zh-cn/resources/frameworks.md b/zh-cn/resources/frameworks.md deleted file mode 100644 index 7898e6b997..0000000000 --- a/zh-cn/resources/frameworks.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -layout: page -title: 基于 Express 的流行框架 -menu: frameworks -lang: zh-cn ---- - -# 基于 Express 的流行框架 - -很多基于 Express 构建的 Node.js 框架: - -- **[Feathers](http://feathersjs.com)**: 在几分钟内建立原型,并在几天内生产就绪的实时应用程序。 -- **[ItemsAPI](https://www.itemsapi.com/)**: 在 Express 和 Elasticsearch 上构建的 Web 和移动应用程序搜索后端。 -- **[KeystoneJS](http://keystonejs.com/)**: 基于 Express 和 MongoDB 搭建的 Node.js CMS 和 web 应用程序平台。 -- **[Kraken](http://krakenjs.com/)**: 通过提供结构和约定来扩展 Express 的安全和可扩展层。 -- **[LEAN-STACK](http://lean-stack.io)**: 纯粹的 JavaScript Stack。 -- **[LoopBack](http://loopback.io)**: 用于快速创建动态端到端 REST API 的高度可扩展的开源 Node.js 框架。 -- **[MEAN](http://mean.io/)**: 完整的全栈 JavaScript 框架,简化和加速 Web 应用程序开发。 -- **[Sails](http://sailsjs.org/)**: Node.js 的 MVC 框架,用于构建实用、生产就绪的应用程序。 -- **[Bottr](http://bottr.co/)**: 简化构建 chatbot 应用程序的框架。 -- **[Hydra-Express](https://github.com/flywheelsports/fwsp-hydra-express)**: Hydra-Express 是一个轻量级库,有助于构建使用 ExpressJS 的 Node.js 微服务。 -- **[Blueprint](http://github.com/onehilltech/blueprint)**: 高度可配置的 MVC 框架,用于从可重用组件组合生产就绪的服务。 -- **[Locomotive](http://locomotivejs.org/)**: 来自 Passport.js 作者, 为 Node.js 构建的强大 MVC Web 框架。 -- **[graphql-yoga](https://github.com/graphcool/graphql-yoga)**: 功能齐全,简单轻便的 GraphQL 服务器。 diff --git a/zh-cn/resources/learning.md b/zh-cn/resources/learning.md deleted file mode 100755 index 9d540a701f..0000000000 --- a/zh-cn/resources/learning.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -layout: page -title: 额外学习 -menu: resources -lang: zh-cn ---- - -# 额外学习 - -
    免责声明:未经认可的社区内容。
    - -## 书籍 - -以下是有关 Express 的众多书籍中的一些: - -- **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, April 2016. - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Getting MEAN with Mongo, Express, Angular, and Node, Second Edition](http://www.manning.com/sholmes2/)**, -Manning Publications, April 2017. - - **[Pro Express.js: Master Express.js: The Node.js Framework For Your Web Development](http://www.apress.com/9781484200384)**, -Apress, December 2014. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 -- **[Builder Book: Build a Full Stack JavaScript Web App from Scratch](https://builderbook.org/book)**, -self-published, February 2018. -- **[MERN Quick Start Guide](https://www.amazon.com/dp/1787281086)**, Packt Publishing, May 2018 -- **[Functional Design Patterns for Express.js](https://jonathanleemartin.com/books/)**, self-published, June 2019. - -### 将你的书籍添加到这! - -[编辑 Markdown 文件](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) 并添加指向您的书籍的链接,然后提交拉取请求(需要 GitHub 登录)。请遵循上述清单的格式。 - -## 博客 - -- [StrongLoop Blog: Express category](https://strongloop.com/strongblog/tag_Express.html) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) -- [Baboon Blog: Express category](http://www.baboon.ir/tutorials/expressjs/) (波斯语) -- [Techforgeek Blog: Express category](http://techforgeek.com/expressjs/) -- [RoseHosting.com Blog: Express tag](https://www.rosehosting.com/blog/tag/express/) -- [ThisHosting.Rocks: Express tag](https://thishosting.rocks/tag/express-js/) -- [Code with Hugo blog: Express tag](https://codewithhugo.com/tags/express) -- [Dev.to blog: Express category](https://dev.to/ghvstcode/understanding-express-middleware-a-beginners-guide-g73) - -### 将你的博客添加到这! - -[编辑 Markdown 文件](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) 并添加指向您的博客的链接,然后提交拉取请求(需要 GitHub 登录)。请遵循上述清单的格式。 - -## DEV 社区 - -[DEV 的 express 标签](https://dev.to/t/express) 是共享 Express 项目,文章和教程以及开始讨论并征求有关 Express 相关主题的反馈的地方。欢迎所有技能水平的开发人员参加。 - -## 视频教程 -- [Learning ExpressJS: Express category](https://getbuzz.io/c/learning-expressjs) -- [Learn Express.js in 14 days](https://iLoveCoding.org/courses/expressjs) - Practice Projects included diff --git a/zh-tw/advanced/best-practice-performance.md b/zh-tw/advanced/best-practice-performance.md index 02a5e9ef93..d77f4c51f5 100755 --- a/zh-tw/advanced/best-practice-performance.md +++ b/zh-tw/advanced/best-practice-performance.md @@ -247,7 +247,7 @@ Node 應用程式一旦遇到未捕捉到的異常狀況,就會當機。首要 * [PM2](https://github.com/Unitech/pm2) * [Forever](https://www.npmjs.com/package/forever) -有關這三種程序管理程式的特性比較,請參閱 [http://strong-pm.io/compare/](http://strong-pm.io/compare/)。如需這三種的詳細介紹,請參閱 [Express 應用程式的程序管理程式](/{{ page.lang }}/advanced/pm.html)。 +有關這三種程序管理程式的特性比較,請參閱 [http://strong-pm.io/compare/](http://strong-pm.io/compare/)。 即使您的應用程式不時發生當機,這些程序管理程式不論哪一個都足以讓您的應用程式維持作用中。 diff --git a/zh-tw/advanced/pm.md b/zh-tw/advanced/pm.md deleted file mode 100755 index 81046e4160..0000000000 --- a/zh-tw/advanced/pm.md +++ /dev/null @@ -1,238 +0,0 @@ ---- -layout: page -title: Express 應用程式的程序管理程式 -menu: advanced -lang: zh-tw ---- - -# Express 應用程式的程序管理程式 - -當您在正式作業中執行 Express 應用程式時,使用*程序管理程式*有助您達成下列作業: - -- 在應用程式當機時,自動重新啟動它。 -- 洞察執行時期效能和資源的耗用情況。 -- 動態修改設定,以改良效能。 -- 控制叢集作業。 - -程序管理程式有點像應用程式伺服器;它是一個應用程式的「儲存器」,有助於部署、提供高可用性,並可讓您在執行時期管理應用程式。 - -對 Express 和其他 Node.js 應用程式來說,最普及的程序管理程式如下: - -- [StrongLoop Process Manager](#sl) -- [PM2](#pm2) -- [Forever](#forever) - - -這三種工具都非常好用,但是 StrongLoop Process Manager 是唯一可以全面提供執行時期和部署解決方案的工具,單以一個統一的介面,就能針對正式作業前後的每一個步驟提供相關工具,來處理整個 Node.js 應用程式的生命週期。 - -以下是這每一個工具的簡要概觀。如需詳細比較,請參閱 [http://strong-pm.io/compare/](http://strong-pm.io/compare/)。 - -## StrongLoop Process Manager - -StrongLoop Process Manager (StrongLoop PM) 是 Node.js 應用程式的正式作業程序管理程式。StrongLoop PM 具有內建的負載平衡、 -監視和多主機部署,以及一個圖形主控台。您可以利用 StrongLoop PM 來執行下列作業: - -- 建置和包裝 Node.js 應用程式,並部署至本端或遠端系統。 -- 檢視 CPU 設定檔和資料堆 Snapshot,使效能達到最佳,並診斷記憶體洩漏情況。 -- 讓程序和叢集永遠維持作用中。 -- 檢視您應用程式上的效能度量。 -- 透過 Nginx 整合,輕鬆管理多主機部署。 -- 將多個 StrongLoop PM 統整成一個分散式微服務執行時期,以便從 Arc 來管理。 - -您可以利用 `slc` 這個功能強大的指令行介面或名為 Arc 的圖形工具,來處理 StrongLoop PM。Arc 是開放程式碼,StrongLoop 會提供專業人員支援。 - -如需相關資訊,請參閱 [http://strong-pm.io/](http://strong-pm.io/)。 - -完整說明文件: - -- [Operating Node apps(StrongLoop 說明文件)](http://docs.strongloop.com/display/SLC) -- [Using StrongLoop Process Manager](http://docs.strongloop.com/display/SLC/Using+Process+Manager). - -### 安裝 - -```console -$ [sudo] npm install -g strongloop -``` - -### 基本用法 - -```console -$ cd my-app -$ slc start -``` - -檢視 Process Manager 和所有已部署應用程式的狀態: - -```console -$ slc ctl -Service ID: 1 -Service Name: my-app -Environment variables: - No environment variables defined -Instances: - Version Agent version Cluster size - 4.1.13 1.5.14 4 -Processes: - ID PID WID Listening Ports Tracking objects? CPU profiling? - 1.1.57692 57692 0 - 1.1.57693 57693 1 0.0.0.0:3001 - 1.1.57694 57694 2 0.0.0.0:3001 - 1.1.57695 57695 3 0.0.0.0:3001 - 1.1.57696 57696 4 0.0.0.0:3001 -``` - -列出所有受管理的應用程式(服務): - -```console -$ slc ctl ls -Id Name Scale - 1 my-app 1 -``` - -停止應用程式: - -```console -$ slc ctl stop my-app -``` - -重新啟動應用程式: - -```console -$ slc ctl restart my-app -``` - -您也可以「軟重新啟動」,這會提供工作者程序一個寬限期,使其有時間關閉現有的連線,再重新啟動現行應用程式: - -```console -$ slc ctl soft-restart my-app -``` - -從管理中移除應用程式: - -```console -$ slc ctl remove my-app -``` - -## PM2 - -PM2 是 Node.js 應用程式的正式作業程序管理程式,具有一個內建的負載平衡器。PM2 容許您讓應用程式永遠維持作用中,並在重新載入時不需關閉,且能協助進行一般的系統管理作業。PM2 也可讓您管理應用程式記載、監視和叢集作業。 - -如需相關資訊,請參閱 [https://github.com/Unitech/pm2](https://github.com/Unitech/pm2)。 - -### 安裝 - -```console -$ [sudo] npm install pm2 -g -``` - -### 基本用法 - -當您使用 `pm2` 指令啟動應用程式時,必須指定應用程式的路徑。不過,當您停止、重新啟動或刪除應用程式時,只需指定應用程式的名稱或 ID 即可。 - -```console -$ pm2 start npm --name my-app -- start -[PM2] restartProcessId process id 0 -┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐ -│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ -├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤ -│ my-app │ 0 │ fork │ 64029 │ online │ 1 │ 0s │ 17.816 MB │ disabled │ -└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘ - Use the `pm2 show ` command to get more details about an app. -``` - -當您使用 `pm2` 指令啟動應用程式時,會立即將應用程式傳送至背景。您可以從指令行使用各種 `pm2` 指令來控制背景的應用程式。 - -使用 `pm2` 指令啟動應用程式之後,會使用 ID 將它登錄在 PM2 的程序清單中。因此,您可以使用其 ID 來管理系統不同目錄中同名的應用程式。 - -請注意,如果有多個同名的應用程式正在執行,全會受到 `pm2` 指令的影響。因此請使用 ID 而非名稱,來管理個別的應用程式。 - -列出所有正在執行的程序: - -```console -$ pm2 list -``` - -停止應用程式: - -```console -$ pm2 stop 0 -``` - -重新啟動應用程式: - -```console -$ pm2 restart 0 -``` - -檢視應用程式的詳細資訊: - -```console -$ pm2 show 0 -``` - -將應用程式從 PM2 登錄移除: - -```console -$ pm2 delete 0 -``` - - -## Forever - -Forever 是一個簡式指令行介面工具,可確保給定的 Script 持續(永遠)執行。Forever 的簡式介面很適合用來執行小型的 Node.js 應用程式和 Script 部署。 - -如需相關資訊,請參閱 [https://github.com/foreverjs/forever](https://github.com/foreverjs/forever)。 - -### 安裝 - -```console -$ [sudo] npm install forever -g -``` - -### 基本用法 - -如果要啟動 Script,請使用 `forever start` 指令,並指定 Script 路徑: - -```console -$ forever start script.js -``` - -這個指令會以常駐程式模式(在背景中)執行 Script。 - -如果要執行 Script,使其附加至終端機,請省略 `start`: - -```console -$ forever script.js -``` - -建議您使用記載選項 `-l`、`-o` 和 `-e`,記載 Forever 工具和 Script 的輸出,如下列範例所示: - -```console -$ forever start -l forever.log -o out.log -e err.log script.js -``` - -檢視 Forever 已啟動的 Script 清單: - -```console -$ forever list -``` - -如果要停止 Forever 已啟動的 Script,請使用 `forever stop` 指令,並指定程序索引(如 `forever list` 指令所列)。 - -```console -$ forever stop 1 -``` - -或者,指定檔案的路徑: - -```console -$ forever stop script.js -``` - -停止 Forever 已啟動的所有 Script: - -```console -$ forever stopall -``` - -Forever 還有諸多選項,也會提供一個程式化 API。 diff --git a/zh-tw/resources/learning.md b/zh-tw/resources/learning.md deleted file mode 100755 index 6b29a3b599..0000000000 --- a/zh-tw/resources/learning.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -layout: page -title: 額外學習 -menu: resources -lang: zh-tw ---- - -# 額外學習 - -
    Disclaimer: Unendorsed community content.
    - -## Books - -Here are a few of the many books on Express: - - - **[Getting MEAN with Mongo, Express, Angular, and Node](http://www.manning.com/sholmes/)**, -Manning Publications, early 2015. - - **[Express.js in Action](http://www.manning.com/hahn/)**, -Manning Publications, early 2015. - - **[Mastering Web Application Development with Express](https://www.packtpub.com/web-development/mastering-web-application-development-express-raw)**, -Packt Publishing, September 2014. - - **[Web Development with Node and Express](http://shop.oreilly.com/product/0636920032977.do)**, -O'Reilly Media, July 2014. - - **[Node.js in Action](http://www.manning.com/cantelon/)**, -Manning Publications, October 2013. - - **[Express Web Application Development](https://www.packtpub.com/web-development/express-web-application-development)**, -Packt Publishing, June 2013. -- **[express - Middleware für node.js](http://www.amazon.de/express-Middleware-node-js-J%C3%B6rg-Krause/dp/1517281342/ref=sr_1_1?ie=UTF8&qid=1442001556&sr=8-1&keywords=1517281342)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[JADE - die Template Engine für node.js](http://www.amazon.de/JADE-Die-Template-Engine-node-js/dp/1517282098/ref=sr_1_1?ie=UTF8&qid=1442001592&sr=8-1&keywords=1517282098)**, -texxtoor, September 2015. In deutscher Sprache / in German language -- **[Node Web Development, 2nd edition](https://www.packtpub.com/web-development/node-web-development-second-edition)**, Packt Publishing, August 2013 - -### Add your book here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your book, then submit a pull request (GitHub login required). Follow the format of the above listings. - -## Blogs - -- [StrongLoop Blog: Express category](http://strongloop.com/strongblog/category/express/) -- [Hage Yaapa's Blog: Express category](http://www.hacksparrow.com/category/express-js) -- [Codeforgeek Blog: Express category](http://codeforgeek.com/code/nodejs/express/) - -### Add your blog here! - -[Edit the Markdown file](https://github.com/expressjs/expressjs.com/blob/gh-pages/{{ page.lang }}/resources/learning.md) and add a link to your blog, then submit a pull request (GitHub login required). Follow the format of the above listings.