Complete guide for developing and hosting robust NestJS applications on Square Cloud.
@nestjs/cli
package globally on your system, allowing you to use the nest
command from anywhere in your terminal.
nest new my-app
is used to create a new NestJS project. The nest new
command is a tool that comes with nest
, the NestJS CLI (Command Line Interface). It is used to initialize a new NestJS application.
my-app
is the name of the new application. This command creates a new directory called my-app
and sets up the necessary files and dependencies for a basic NestJS application.
nest new my-app
command, the file you need to modify to change the port is main.ts
. This file is located at the root of your project directory, inside the src
folder.
build
script defined in your package.json
file, which in turn runs the nest build
command. This command compiles your TypeScript code to JavaScript.
MAIN
field of squarecloud.app. For a NestJS application, the main file is the compiled JavaScript file from your main.ts
file, which is dist/main.js
.
Here’s how you can configure it:
mysite.com
) instead of the default URL https://mysite.squareweb.app/
, you need the Standard plan or higher. The subdomain is defined by the SUBDOMAIN field in the configuration file. See: How to set up your custom domain..env
file.