You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to make development easier for me and my coworkers so i wanted to have baked in documentation for developers in the company.
Let's say i'm creating a simple authentication flow based on OTP in Nest.js
@ApiTags('auth')
@Controller('auth')exportclassAuthController{constructor(privatereadonlyauthService: AuthService){}
@Get('/otp')
@ApiOperation({summary:
'This is used for logging the user in when testing the app. It will send to you an OTP code to your phone number. After this you should log in with "/login" endpoint.',})
@ApiQuery({name: 'phoneNumber',description: 'The phone number to send the OTP code to, so you can log in.',required: true,type: String,example: '+5511970852396',// this is my phone number, i wanted this to be dynamic then other co-workers that will to run this code don't need to manually change this.})
@ApiResponse({status: 200,description:
'If you receive a 200 HTTP status code, the OTP code was sent to the phone number.',})asyncsendOtpCode(@Query('phoneNumber')phoneNumber?: string){if(phoneNumber)awaitthis.authService.otp(phoneNumber);return;}}
I could create a json file alongside with the team members and we would be able to configure our phone numbers to better document everything.
Another use case might be for mobile development. When i'm developing for mobile and want to run the code on my device i can't use localhost, instead i need to transform the localhost to my actual host of my wifi router.
constclient=newQueryClient();storage.setSecureStorage(secureStorage);storage.setUnsecureStorage(unsecureStorage);api.setApiPath(__DEV__ ? config.api.url.replace('localhost','192.168.0.211') : config.api.url);// i wanted to manually configure the localhost replacement for the user running the application when in developmentapi.setPrefix('api');voidinitializePolyfills(['format-js']);exportdefaultfunctionApp(){// rest of code}
With this i can improve the DX on our projects.
The text was updated successfully, but these errors were encountered:
Hey! How can app-config help solve this problem? Isn't it possible already to put teamMembers in configuration? Or maybe I've missed how this would work.
An example of what app-config files might look like would help
I want to make development easier for me and my coworkers so i wanted to have baked in documentation for developers in the company.
Let's say i'm creating a simple authentication flow based on OTP in Nest.js
I could create a json file alongside with the team members and we would be able to configure our phone numbers to better document everything.
Another use case might be for mobile development. When i'm developing for mobile and want to run the code on my device i can't use localhost, instead i need to transform the
localhost
to my actual host of my wifi router.With this i can improve the DX on our projects.
The text was updated successfully, but these errors were encountered: