Installation

How to install REstJS and set up your development environment.

2 min readEdit this page

Requirements

RequirementVersion
Node.js18.0.0 or higher
npm8.0.0 or higher
TypeScript5.0.0 or higher

Install the CLI

npm install -g @restjs/cli

Verify the installation:

rest --version

Create a project

rest create my-api

This generates a new project with:

  • Pre-configured TypeScript
  • Standard directory structure
  • Sample controller and service
  • Environment configuration
  • .gitignore with sensible defaults

Project structure

my-api/
├── src/
│   ├── main.ts
│   ├── config/
│   │   └── app.config.ts
│   └── modules/
│       └── users/
│           ├── controllers/
│           ├── services/
│           └── users.test.ts
├── package.json
├── tsconfig.json
├── .env
└── .env.example

Install dependencies

cd my-api
npm install

Start the server

rest run

The development server starts with hot reload. Every file save triggers incremental TypeScript compilation and automatic restart.

Tip

Run rest doctor inside your project to check for configuration issues.

Available CLI commands

rest create <name>        # Create a new project
rest run                  # Start dev server with hot reload
rest build                # Compile for production
rest test [pattern]       # Run test files
rest deploy               # Generate Docker + K8s files
rest install [package]    # Install a package
rest doctor               # Diagnose project issues