forked from Onix-Systems/nest-js-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
70 changed files
with
801 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = [ | ||
{ | ||
type: 'list', | ||
name: 'deploy:heroku', | ||
message: 'Do you want to have a possibillity to deploy on heroku?', | ||
default: 'No', | ||
choices: ['Yes', 'No'], | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
SERVER_PORT=<%= config.serverPort %> | ||
|
||
<% if(config.wantedDocker === 'Yes') { %> | ||
MONGODB_URL=mongodb://mongodb:27017/app | ||
REDIS_URL=redis://redis:6379 | ||
<% } %> | ||
|
||
<% if(config.wantedDocker === 'No') { %> | ||
MONGODB_URL=mongodb://localhost:27017/app | ||
REDIS_URL=redis://localhost:6379 | ||
<% } %> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
generators/auth/templates/mongodb/jwt/src/components/app/app.controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import AppService from '@components/app/app.service'; | ||
import { ApiOkResponse } from '@nestjs/swagger'; | ||
import { Controller, Get } from '@nestjs/common'; | ||
|
||
@Controller() | ||
export default class AppController { | ||
constructor(private readonly appService: AppService) {} | ||
|
||
@ApiOkResponse({ description: 'Returns you Hello world!' }) | ||
@Get() | ||
sayHello(): string { | ||
return this.appService.getHello(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,8 @@ export default class AppService { | |
|
||
await open(url); | ||
} | ||
|
||
getHello(): string { | ||
return 'Hello world!'; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
generators/auth/templates/mongodb/jwt/src/components/app/app.utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { Type } from '@nestjs/common'; | ||
|
||
const DtoFactory = { | ||
wrap<T>(responseDto: T): Type<unknown> { | ||
class SuccessResponseDto { | ||
@ApiProperty({ type: String }) | ||
public message: string = ''; | ||
|
||
@ApiProperty({ type: responseDto }) | ||
public data: T | null = null; | ||
} | ||
|
||
return SuccessResponseDto; | ||
}, | ||
}; | ||
|
||
const AppUtils = { | ||
DtoFactory, | ||
}; | ||
|
||
export default AppUtils; |
23 changes: 23 additions & 0 deletions
23
generators/auth/templates/mongodb/jwt/src/components/auth/auth-constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const authConstants = { | ||
jwt: { | ||
secret: '<%= config.jwtSecret %>', | ||
expirationTime: { | ||
accessToken: '<%= config.refreshTokenExpirationTime %>', | ||
refreshToken: '<%= config.accessTokenExpirationTime %>', | ||
}, | ||
secrets: { | ||
accessToken: '<%= config.accessTokenSecret %>', | ||
refreshToken: '<%= config.refreshTokenSecret %>', | ||
}, | ||
}, | ||
redis: { | ||
expirationTime: { | ||
jwt: { | ||
accessToken: 86400, // 1d | ||
refreshToken: 604800, // 7d | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default authConstants; |
Oops, something went wrong.