Documentation

menu
ModulesNodejsHaskellRustPostgreSQLUserHostingIntroductionBranch HostingPull-request DeploymentsSecretsPersistenceDebuggingMultiple ServersCustom DomainsExample: Typescript & GoExample: JitsiExample: RSS BridgeExample: Tiny Tiny RSSExample: SearxInstalling Nixyaml configNix FlakesWhat Garnix CI doesIncremental BuildsUsing Private InputsCachingGitHub Actions IntegrationBadgesGarn

NodeJS Moduleshare

This module allows building, testing, and deploying NodeJS projects.

It expects a project that can be built with npm run build. You can optionally also set a similar test command, in which case that becomes a separate CI check. You can additionally enable a prettier check for formatting.

If additionally your project is a web server (either frontend or backend), you can deploy it by enabling the "Web Server" option. Tell us which command to run to start the server, which port your application listens on, and the API path. The API path is in particular useful if you have multiple servers running (e.g., a backend and a frontend), and it allows you to, for example, route /api to your backend server.

Once deployed your server will be available on a URL based on your branch name, or directly via IP address. You can see your running servers in your servers tab. See also the custom domains section of our docs for how to use custom domains with your deployment.

Remember that you can combine modules, so if you have a NodeJS web server, you might want to look at the User module so you can SSH into your server, a Haskell or Rust backend, and the PostgreSQL module for a database.