> ## Documentation Index
> Fetch the complete documentation index at: https://developer.upsun.com/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript/Node.js

> All you need to know about configuring a new Javascript/Node.js project with Upsun Cloud

When dealing with Javascript/Node.js stacks, the information below may help customize your configuration.
These sections provide Javascript/Node.js-specific configuration details, but you can also refer to the common Upsun documentation:

* [Configuring applications](https://developer.upsun.com/docs/configure-apps)
* [Setting up managed services](https://developer.upsun.com/docs/add-services)
* [Handling requests](https://developer.upsun.com/docs/routes)

## Build flavors

By default, Upsun Cloud makes assumptions about how you want to build your application.
Namely, that you are managing your dependencies with npm, and that the very first thing you'd like to run is a particular and common production flavor of `npm install`.

This is called a build `flavor`, but its assumption may prove inappropriate for your application and cause your builds to fail (such as if you'd like to use yarn or bun instead of npm).
Therefore, you can [disable this feature](https://developer.upsun.com/docs/languages/nodejs#dependencies).

## Available package managers

Certain package managers come pre-installed on all Upsun Cloud `nodejs` container types:

* *npm*; example: `npm install platformsh-config`
* *npx*; example: `npx create-strapi-app <APP_NAME>`
* *bun*; example: `bun install platformsh-config`

You can also use Yarn if you [install it explicitly](https://developer.upsun.com/docs/languages/nodejs#use-yarn-as-a-package-manager), or [nvm](https://developer.upsun.com/docs/languages/nodejs/node-version.md#use-nvm).

## Sample configuration

Below are some examples from common Node.js framework configuration:

> [tab] Next.js
>
> &#x20;       applications:
> &#x20;         \<APP\_NAME>:
> &#x20;           source:
> &#x20;             root: "/"
> &#x20;           type: "nodejs:\{\{version:nodejs:latest}}"
> &#x20;           web:
> &#x20;             commands:
> &#x20;               start: "npx next start -p \$PORT"
> &#x20;           build:
> &#x20;             flavor: none
> &#x20;           dependencies:
> &#x20;             nodejs:
> &#x20;               sharp: "\*"
> &#x20;       \#services:
> &#x20;       \#  db:
> &#x20;       \#    type: postgresql:\{\{version:postgresql:latest}}
> &#x20;       routes:
> &#x20;         "https\://\{default}/":
> &#x20;           type: upstream
> &#x20;           upstream: "myapp:http"
> &#x20;         \# A basic redirect definition
> &#x20;         \# More information: /docs/routes#basic-redirect-definition
> &#x20;         "[https://www.\{default}/](https://www.\{default}/)":
> &#x20;           type: redirect
> &#x20;           to: "https\://\{default}/"

> [tab] Express
>
> &#x20;       applications:
> &#x20;         \<APP\_NAME>:
> &#x20;           source:
> &#x20;             root: "/"
> &#x20;           type: "nodejs:\{\{version:nodejs:latest}}"
> &#x20;           web:
> &#x20;             commands:
> &#x20;               start: "node index.js"
> &#x20;           build:
> &#x20;             flavor: none
> &#x20;           dependencies:
> &#x20;             nodejs:
> &#x20;               sharp: "\*"
> &#x20;       \#services:
> &#x20;       \#  db:
> &#x20;       \#    type: postgresql:\{\{version:postgresql:latest}}
> &#x20;       routes:
> &#x20;         "https\://\{default}/":
> &#x20;           type: upstream
> &#x20;           upstream: "myapp:http"
> &#x20;         \# A basic redirect definition
> &#x20;         \# More information: /docs/routes#basic-redirect-definition
> &#x20;         "[https://www.\{default}/](https://www.\{default}/)":
> &#x20;           type: redirect
> &#x20;           to: "https\://\{default}/"

> [tab] Strapi
>
> &#x20;       applications:
> &#x20;         \<APP\_NAME>:
> &#x20;           source:
> &#x20;             root: "/"
> &#x20;           type: "nodejs:\{\{version:nodejs:latest}}"
> &#x20;           relationships:
> &#x20;             postgresql:
> &#x20;           mounts:
> &#x20;             ...
> &#x20;           web:
> &#x20;             commands:
> &#x20;               start: "NODE\_ENV=production yarn start"
> &#x20;           build:
> &#x20;             flavor: none
> &#x20;           dependencies:
> &#x20;             nodejs:
> &#x20;               yarn: "^1.22.0"
> &#x20;           hooks:
> &#x20;             build: |
> &#x20;               set -eux
> &#x20;               yarn
> &#x20;               yarn build
> &#x20;       services:
> &#x20;         postgresql:
> &#x20;           type: postgresql:\{\{version:postgresql:latest}}
>
> &#x20;       routes:
> &#x20;         "https\://\{default}/":
> &#x20;           type: upstream
> &#x20;           upstream: "myapp:http"
> &#x20;         \# A basic redirect definition
> &#x20;         \# More information: /docs/routes#basic-redirect-definition
> &#x20;         "[https://www.\{default}/](https://www.\{default}/)":
> &#x20;           type: redirect
> &#x20;           to: "https\://\{default}/"

## Frameworks

The Upsun documentation includes a wide array of community resources to help with framework-specific configuration:

* [Express](https://developer.upsun.com/docs/get-started/stacks/express)
* [Next.js](https://developer.upsun.com/docs/get-started/stacks/nextjs.md)
* [Strapi](https://developer.upsun.com/docs/get-started/stacks/strapi)

## Get support

While there are virtually no restrictions to you deploying any kind of application on Upsun Cloud, configuration may still be unclear at this point.

Not to worry! The Upsun community is here to help.
Come and say hello, share your work, ask for help, and peek in on what others are working on.

Welcome to the Upsun community!

[Join the Community Forum](https://community.upsun.com/)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.