{% extends "sentry/partial/client_config/node_base.html" %}

{% load i18n %}

{% block inner %}

	<p>{% blocktrans with 'https://github.com/mattrobenolt/raven-node' as link %}Start by installing <a href="{{ link }}">raven-node</a>:{% endblocktrans %}</p>

	<pre>npm install raven</pre>

	<p>{% trans "Register an instance of the Connect middleware <strong>after your main application handler</strong>:" %}</p>

	<pre>connect(
  connect.bodyParser(),
  connect.cookieParser(),
  mainHandler,
  raven.middleware.connect('{% if dsn %}{{ dsn }}{% else %}<strong>SENTRY_DSN</strong>{% endif %}'),
).listen(3000);</pre>

	<p>{% trans "Ensure Node is run with <code>NODE_ENV=production</code>:" %}</p>

	<pre>NODE_ENV=production node script.js</pre>

	<p>{% trans "That's it! Raven automatically installs an error handling hook to pipe all uncaught exceptions to Sentry." %}</p>

	<p>{% blocktrans with 'https://github.com/mattrobenolt/raven-node' as link %}For more information on other uses of Raven with Node.js, please see the <a href="{{ link }}">official documentation for raven-node</a>.{% endblocktrans %}</p>

{% endblock %}