1. Create project
npm i -g @nestjs/cli
nest new tasks-api
npm run start:dev
2. Overview and delete files
3. Create module
nest g mo tasks
npm i -g @nestjs/cli
nest new tasks-api
npm run start:dev
nest g mo tasks
const data = [1,3,4,5]; | |
const rta = data.reduce((counter, item) => counter + item, 0); | |
console.log(rta); | |
const orders = [ | |
{ | |
customerName: 'Nicolas', | |
total: 60, | |
delivered: true, | |
}, |
const orders = [ | |
{ | |
customerName: 'Nicolas', | |
total: 60, | |
delivered: true, | |
}, | |
{ | |
customerName: 'Zulema', | |
total: 120, | |
delivered: false, |
.github/workflows/lighthouse-ci.yml | |
```yml | |
name: Lighthouse CI | |
on: [push] | |
jobs: | |
lhci: | |
name: Lighthouse CI | |
runs-on: ubuntu-latest | |
steps: |
const numbers = [1,2,3,4]; | |
// Mutable | |
for (let index = 0; index < numbers.length; index++) { | |
numbers[index] = numbers[index] + 2; | |
} | |
console.log(numbers); | |
// Inmutable v1 | |
const newNumbers = []; | |
for (let index = 0; index < numbers.length; index++) { |
npm install -g @lhci/cli
import { Component, OnInit, forwardRef } from '@angular/core'; | |
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; | |
@Component({ | |
selector: 'app-stepper', | |
templateUrl: './stepper.component.html', | |
styleUrls: ['./stepper.component.scss'], | |
providers: [ | |
{ | |
provide: NG_VALUE_ACCESSOR, |
interface Marker {
lat: number;
lng: number;
title: string;
image: string;
text: string;
markerObj?: any;
npm install --save @nestjs/typeorm typeorm pg
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { configService } from './config/config.service';
const averageTempJan = 31.9;
const averageTempJan = 35.3;
const averageTempMar = 42.4;
const averageTempApr = 52;