-
Notifications
You must be signed in to change notification settings - Fork 0
/
reminder.txt
98 lines (63 loc) · 2.28 KB
/
reminder.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Generate a Controller
$ nest generate controller
// shorthand: $ nest g co
// to see the path use --dry-run
nest generate controller modules/abc --dry-run
// Generate a Service with the Nest CLI
nest generate service {name}
// shorthand: nest g s {name}
// Generate a Nest Module with the Nest CLI
nest g module {name}
// shorthand: nest g mo {name}
/**
* Generate a DTO class with the Nest CLI
* --no-spec (no test file needed for DTO's)
*/
nest g class coffees/dto/create-coffee.dto --no-spec
/* Generate Entity Class */
nest g class coffees/entities/flavor.entity --no-spec
// Creating a TypeOrm Migration
npx typeorm migration:create src/migrations/CoffeeRefactor
// CoffeeRefactor being the NAME we are giving "this" migration
/* RUNNING MIGRATIONS */
/**
* 💡 Remember 💡
* You must BUILD your Nest project (so that everything is output to the `/dist/` folder,
* before a Migration can run, it needs compilated files.
*/
// Compile project first
npm run build
// Run migration(s)
npx typeorm migration:run -d dist/typeorm-cli.config
// REVERT migration(s)
npx typeorm migration:revert -d dist/typeorm-cli.config
// Let TypeOrm generate migrations (for you)
npx typeorm migration:generate src/migrations/SchemaSync -d dist/typeorm-cli.config
// Nest CLI - Generate a new CoffeeRatingModule
nest g mo coffee-rating
// Nest CLI - Generate a new CoffeeRatingService
nest g s coffee-rating
// Generate a DatabaseModule
nest g mo database
// Install @nestjs/config
npm i @nestjs/config
// Generate Filter with Nest CLI
nest g filter common/filters/http-exception
// Generate ApiKeyGuard with Nest CLI
nest g guard common/guards/api-key
// Generate WrapResponseInterceptor with Nest CLI
nest g interceptor common/interceptors/wrap-response
// Generate Time out Interceptor with Nest CLI
nest g interceptor common/interceptors/timeout
/* Generate TimeoutInterceptor with Nest CLI */
nest g interceptor common/interceptors/timeout
// Generate ParseIntPipe with Nest CLI
nest g pipe common/pipes/parse-int
// Generate LoggingMiddleware with Nest CLI
nest g middleware common/middleware/logging
// Generate LoggingMiddleware with Nest CLI
nest g middleware common/middleware/logging
// Apply LoggingMiddleware in our AppModule
consumer
.apply(LoggingMiddleware)
.forRoutes(‘*’);