Skip to content

Commit

Permalink
Add official guide of node.js applications
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior authored Sep 17, 2024
1 parent f7027bc commit 3191839
Showing 1 changed file with 3 additions and 41 deletions.
44 changes: 3 additions & 41 deletions nodejs/README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,4 @@
# Nodejs platform
Node.js platform
===========

The Nodejs platform uses nvm to run your code and you can choose what node
version you want to run it. To define node version you have three ways:

* .nvmrc
$ cat .nvmrc
4.4.0
* .node-version
$ cat .node-version
4.4.0
* package.json
$ cat package.json
...
"engines": {
"node": "4.2.6",
},
...

This file should be in the root of deploy files.

$ ls
Procfile app.js hook.js package.json

To install your dependencies, first we check if there is a `yarn.lock` file
in the root of your files. If so, we use [yarn](https://yarnpkg.com/);
otherwise, we use [npm](https://www.npmjs.com/package/npm).

You have to list your dependencies in the `package.json` file.

$ cat package.json
...
"dependencies": {
"express": "3.x"
}
...

If you want to also install development dependencies, set the environment
variable ``NPM_CONFIG_PRODUCTION=false``. Otherwise, we'll only install
regular dependencies.
You can also cache your node_modules by setting environment variable
``KEEP_NODE_MODULES=true``.
Official guide: https://tsuru.github.io/docs/user_guides/deploy_nodejs_apps/

0 comments on commit 3191839

Please sign in to comment.