doc(samples) update samples

This commit is contained in:
John Biundo
2019-09-16 14:26:41 -07:00
parent 35c79bd491
commit 5535967277
21 changed files with 42994 additions and 7 deletions

1457
sample/03-microservices/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
### SQL TypeORM sample
### Installation
`npm install`
### Running
This example requires docker or a local MySQL installation. If using a local MySQL database, see `app.module.ts` for credentials, and make sure there are matching credentials in the database and the source code.
#### Docker
There is a `docker-compose.yml` file for starting Docker.
`docker-compose up`
After running the sample, you can stop the Docker container with
`docker-compose down`
### Run the sample
Then, run Nest as usual:
`npm run start`

View File

@@ -0,0 +1,27 @@
### Mongoose sample
### Installation
`npm install`
### Running
This example requires docker or a local mongodb installation. If using a local mongodb, see `app.module.ts` for connection options, and make sure there are matching options for the mongodb installation and the source code.
#### Docker
There is a `docker-compose.yml` file for starting Docker.
`docker-compose up`
After running the sample, you can stop the Docker container with
`docker-compose down`
### Run the sample
Then, run Nest as usual:
`npm run start`

1536
sample/06-mongoose/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
### Sequelize sample
### Installation
`npm install`
### Running
This example requires docker or a local MySQL installation. If using a local MySQL database, see `database/database.providers.ts` for credentials, and make sure there are matching credentials in the database and the source code.
#### Docker
There is a `docker-compose.yml` file for starting Docker.
`docker-compose up`
After running the sample, you can stop the Docker container with
`docker-compose down`
### Run the sample
Then, run Nest as usual:
`npm run start`

1676
sample/07-sequelize/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

4458
sample/09-babel-example/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
### Fastify sample
Note that if you are running the Nest app on a remote machine, you may need to change the listen address, as per [these instructions](https://docs.nestjs.com/techniques/performance#adapter):
`await app.listen(3000, '0.0.0.0')`

1216
sample/10-fastify/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

2820
sample/12-graphql-apollo/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
### Mongoose sample
### Installation
`npm install`
### Running
This example requires docker or a local mongodb installation. If using a local mongodb, see `app.module.ts` for connection options, and make sure there are matching options for the mongodb installation and the source code.
#### Docker
There is a `docker-compose.yml` file for starting Docker.
`docker-compose up`
After running the sample, you can stop the Docker container with
`docker-compose down`
### Run the sample
Then, run Nest as usual:
`npm run start`

1904
sample/13-mongo-typeorm/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

1456
sample/16-gateways-ws/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
### Fastify MVC sample
Note that if you are running the Nest app on a remote machine, you may need to change the listen address, as per [these instructions](https://docs.nestjs.com/techniques/performance#adapter):
`await app.listen(3000, '0.0.0.0')`

8520
sample/19-auth-jwt/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

6117
sample/20-cache/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -4,10 +4,13 @@
"description": "Nest TypeScript starter repository", "description": "Nest TypeScript starter repository",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"build": "tsc -p tsconfig.build.json", "build": "rimraf dist && tsc -p tsconfig.build.json",
"start": "ts-node src/main", "start": "ts-node -r tsconfig-paths/register src/main.ts",
"start:dev": "tsc-watch -p tsconfig.build.json --onSuccess \"node dist/main.js\"",
"start:debug": "tsc-watch -p tsconfig.build.json --onSuccess \"node --inspect-brk dist/main.js\"",
"prestart:prod": "npm run build", "prestart:prod": "npm run build",
"start:prod": "node dist/main.js" "start:prod": "node dist/main.js",
"lint": "tslint -p tsconfig.json -c tslint.json"
}, },
"dependencies": { "dependencies": {
"@nestjs/common": "6.6.7", "@nestjs/common": "6.6.7",
@@ -27,6 +30,9 @@
"supertest": "4.0.2", "supertest": "4.0.2",
"ts-jest": "24.1.0", "ts-jest": "24.1.0",
"ts-node": "8.4.1", "ts-node": "8.4.1",
"tslint": "5.20.0" "tslint": "5.20.0",
"rimraf": "^2.6.2",
"tsc-watch": "2.2.1",
"tsconfig-paths": "3.8.0"
} }
} }

View File

@@ -5,4 +5,4 @@ import { AppController } from './app.controller';
imports: [CacheModule.register()], imports: [CacheModule.register()],
controllers: [AppController], controllers: [AppController],
}) })
export class ApplicationModule {} export class AppModule {}

View File

@@ -1,9 +1,9 @@
import { ValidationPipe } from '@nestjs/common'; import { ValidationPipe } from '@nestjs/common';
import { NestFactory } from '@nestjs/core'; import { NestFactory } from '@nestjs/core';
import { ApplicationModule } from './app.module'; import { AppModule } from './app.module';
async function bootstrap() { async function bootstrap() {
const app = await NestFactory.create(ApplicationModule); const app = await NestFactory.create(AppModule);
app.useGlobalPipes(new ValidationPipe()); app.useGlobalPipes(new ValidationPipe());
await app.listen(3000); await app.listen(3000);
} }

6059
sample/21-serializer/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

5646
sample/22-graphql-prisma/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff