diff --git a/docs/overview/controller.md b/docs/overview/controller.md index 2af5233e..2b4b522f 100644 --- a/docs/overview/controller.md +++ b/docs/overview/controller.md @@ -45,27 +45,22 @@ As a result, DTOs help to segregate and filter the data being sent to the client ## Controller Class -The controller class in ExpressoTS represents the endpoint that you want to create for your application. You can define the route and HTTP method for the controller by using the `@controller()` decorator from the [Inversify Express Utils package](https://github.com/inversify/inversify-express-utils). +The controller class in ExpressoTS represents the endpoint that you want to create for your application. You can define the route and HTTP method for the controller by using the `@controller()` decorator from the [Decorator section](./decorators.md). -Each controller class contains a single method called `execute()` that handles the request and sends the response. This method is annotated with the **[@httpMethods()](./decorators.md)** decorators. Additionally, you can also annotate the parameters of the `execute()` method. +Each controller class contains a single method called `execute()` that handles the request and sends the response. This method is annotated with the **[http methods](./decorators.md#http-method-decorators)** decorators. Additionally, you can also annotate the parameters of the `execute()` method. Here is an example of a simple ExpressoTS controller class: ```typescript @controller("/") class AppController { - - @httpGet("/") - execute(@response() res: any) { - return res.send("Hello from ExpressoTS!"); - } + @Get("/") + execute(@response() res: Response) { + return res.send("Hello from ExpressoTS!"); + } } ``` -:::info -In the AppController class above we are using res as any (`res:any`), but the `res:Response` type from the `express` package is also available for use. This allows you to make use of all the methods that the **[Response](https://expressjs.com/en/4x/api.html#res)** type offers. -::: - ## BaseController Class We also power a controller class with the `BaseController` class that offers in the constructor a parameter that the developer can indicate what service or domain he is currently building. This helps the log system throw errors with more information about the context of the error and where the error occurred. @@ -84,9 +79,9 @@ The signature of the `callUseCase` method: callUseCase(useCase: any, res: any, successStatusCode: number); ``` -- `useCase`: The use case that will be called. This use case is injected in the controller constructor. -- `res`: The response object from the express request. -- `successStatusCode`: The status code that will be sent to the client if the use case is executed successfully. Please see the **[Http Status Code](./status-code.md)** type for more information. +- `useCase`: The use case that will be called. This use case is injected in the controller constructor. +- `res`: The response object from the express request. +- `successStatusCode`: The status code that will be sent to the client if the use case is executed successfully. Please see the **[Http Status Code](./status-code.md)** type for more information. The default response: @@ -99,17 +94,14 @@ A more complete example of a controller class inheriting from the **BaseControll ```typescript @controller("/") class AppController extends BaseController { - constructor(private appUseCase: AppUseCase) { - super("app-controller"); - } - - @httpGet("/") - execute(@response() res: any): IAppResponseDTO { - return this.callUseCase(this.appUseCase.execute(), - res, - StatusCode.OK - ); - } + constructor(private appUseCase: AppUseCase) { + super("app-controller"); + } + + @httpGet("/") + execute(@response() res: any): IAppResponseDTO { + return this.callUseCase(this.appUseCase.execute(), res, StatusCode.OK); + } } ``` @@ -127,7 +119,7 @@ Here is an example of usage: ```typescript @scope(BindingScopeEnum.Singleton) @controller("/") -class CreateUserController extends BaseController { } +class CreateUserController extends BaseController {} ``` The controller above will be scoped as `Singleton` and will be shared across all requests. @@ -174,30 +166,30 @@ Here is an example of use MVC approach, which contains a single controller class ```typescript @controller("/product") class ProductController { - @httpPost("/") - create(@response() res: any) { - return res.status(201).json({ message: "Product created" }); - } - - @httpGet("/") - list(@response() res: any) { - return res.status(200).json({ message: "Product listed" }); - } - - @httpGet("/:id") - get(@response() res: any) { - return res.status(200).json({ message: "Product get" }); - } - - @httpPatch("/:id") - update(@response() res: any) { - return res.status(200).json({ message: "Product updated" }); - } - - @httpDelete("/:id") - delete(@response() res: any) { - return res.status(200).json({ message: "Product deleted" }); - } + @httpPost("/") + create(@response() res: any) { + return res.status(201).json({ message: "Product created" }); + } + + @httpGet("/") + list(@response() res: any) { + return res.status(200).json({ message: "Product listed" }); + } + + @httpGet("/:id") + get(@response() res: any) { + return res.status(200).json({ message: "Product get" }); + } + + @httpPatch("/:id") + update(@response() res: any) { + return res.status(200).json({ message: "Product updated" }); + } + + @httpDelete("/:id") + delete(@response() res: any) { + return res.status(200).json({ message: "Product deleted" }); + } } ``` @@ -207,9 +199,9 @@ class ProductController { ExpressoTS is an MIT-licensed open source project. It's an independent project with ongoing development made possible thanks to your support. If you'd like to help, please consider: -- Become a **[sponsor on GitHub](https://github.com/sponsors/expressots)** -- Follow the **[organization](https://github.com/expressots)** on GitHub and Star ⭐ the project -- Subscribe to the Twitch channel: **[Richard Zampieri](https://www.twitch.tv/richardzampieri)** -- Join our **[Discord](https://discord.com/invite/PyPJfGK)** -- Contribute submitting **[issues and pull requests](https://github.com/expressots/expressots/issues/new/choose)** -- Share the project with your friends and colleagues \ No newline at end of file +- Become a **[sponsor on GitHub](https://github.com/sponsors/expressots)** +- Follow the **[organization](https://github.com/expressots)** on GitHub and Star ⭐ the project +- Subscribe to the Twitch channel: **[Richard Zampieri](https://www.twitch.tv/richardzampieri)** +- Join our **[Discord](https://discord.com/invite/PyPJfGK)** +- Contribute submitting **[issues and pull requests](https://github.com/expressots/expressots/issues/new/choose)** +- Share the project with your friends and colleagues diff --git a/docs/overview/first-steps.md b/docs/overview/first-steps.md index 66043b0d..478768c2 100644 --- a/docs/overview/first-steps.md +++ b/docs/overview/first-steps.md @@ -12,15 +12,15 @@ We believe in the power of strongly typed languages, and **[TypeScript](https:// ## Why TypeScript? -- Improved code quality: Strong typing helps to catch errors and bugs at compile time, rather than at runtime, which helps to improve the overall quality of the code. This can lead to fewer crashes and issues with the code in production. +- Improved code quality: Strong typing helps to catch errors and bugs at compile time, rather than at runtime, which helps to improve the overall quality of the code. This can lead to fewer crashes and issues with the code in production. -- Better scalability: Strong typing can help make code more scalable by allowing for easier refactoring and maintenance. This is because strong typing ensures that changes to the code are consistent and predictable, making it easier to add new features or modify existing ones. +- Better scalability: Strong typing can help make code more scalable by allowing for easier refactoring and maintenance. This is because strong typing ensures that changes to the code are consistent and predictable, making it easier to add new features or modify existing ones. -- Increased productivity: Strong typing can increase developer productivity by providing better tooling and editor support, such as code completion, type inference, and automatic refactoring. This can help developers write code faster and with fewer errors. +- Increased productivity: Strong typing can increase developer productivity by providing better tooling and editor support, such as code completion, type inference, and automatic refactoring. This can help developers write code faster and with fewer errors. -- Improved collaboration: Strong typing can make it easier for developers to collaborate by providing a shared understanding of the types and interfaces used in the codebase. This can help reduce misunderstandings and inconsistencies and make it easier for developers to work together on the same codebase. +- Improved collaboration: Strong typing can make it easier for developers to collaborate by providing a shared understanding of the types and interfaces used in the codebase. This can help reduce misunderstandings and inconsistencies and make it easier for developers to work together on the same codebase. -- Better documentation: Strong typing can help make code more self-documenting by providing a clear and concise description of the types and interfaces used in the code. This can help reduce the need for extensive comments and documentation, making the code easier to understand and maintain. +- Better documentation: Strong typing can help make code more self-documenting by providing a clear and concise description of the types and interfaces used in the code. This can help reduce the need for extensive comments and documentation, making the code easier to understand and maintain. ## Pre-requisites @@ -49,8 +49,8 @@ expressots new -t -p :::tip ExpressoTS offers two options for project templates: -- Non-opinionated: Want to have the liberty to build and structure your project as you wish? Non opinionated template offers a very small footprint, with only the necessary files to get you started. -- Opinionated: Opinionated template is made for more complex projects, as it provides a more layered architecture. +- Non-opinionated: Want to have the liberty to build and structure your project as you wish? Non opinionated template offers a very small footprint, with only the necessary files to get you started. +- Opinionated: Opinionated template is made for more complex projects, as it provides a more layered architecture. ::: @@ -92,8 +92,6 @@ project-name/ │ ├── providers/ │ │ └── application/ │ │ └── application.provider.ts -│ │ └── db-in-memory/ -│ │ └── db-in-memory.provider.ts │ ├── repositories/ │ │ └── user/ │ │ └── user-repository.ts @@ -146,9 +144,9 @@ Below you can find some extra information about **[Providers](./providers.md)**, Contain 2 providers: -- application: This provider is a class that extend from the Application class from @expressots/core that provides the application **[Life Cycle Hooks](application.md#lifecycle-hooks)**. +- application: This provider is a class that extend from the Application class from @expressots/core that provides the application **[Life Cycle Hooks](application.md#lifecycle-hooks)**. -- db-in-memory: This is a simple in-memory database provider that allows you to store data in memory. We use this provider in the User use cases to store and retrieve user data. +- db-in-memory: This is a simple in-memory database provider that allows you to store data in memory. We use this provider in the User use cases to store and retrieve user data. :::info InMemoryDB provider is an example supplied to help you prototype endpoints quickly without having to worry about setting up a database. It is not intended to be used in production. You can replace it with your own database provider. @@ -158,16 +156,16 @@ InMemoryDB provider is an example supplied to help you prototype endpoints quick The use cases in the Opinionated template are organized in 2 modules: -- AppModule and UserModule, providing some examples of usage of the ExpressoTS resources. For more information about modules, please check the **[Modules Section](./module.md)**. +- AppModule and UserModule, providing some examples of usage of the ExpressoTS resources. For more information about modules, please check the **[Modules Section](./module.md)**. Here are the endpoints in each module: -- [AppModule]/app.controller: returns `Hello from ExpressoTS App` -- [UserModule]/user-create.controller: creates a new user in the in-memory database -- [UserModule]/user-delete.controller: delete a user by `id` in the in-memory database -- [UserModule]/user-find.controller: return one user from the in-memory database -- [UserModule]/user-findall.controller: returns all users from the in-memory database -- [UserModule]/user-update.controller: update a user info from the in-memory database +- [AppModule]/app.controller: returns `Hello from ExpressoTS App` +- [UserModule]/user-create.controller: creates a new user in the in-memory database +- [UserModule]/user-delete.controller: delete a user by `id` in the in-memory database +- [UserModule]/user-find.controller: return one user from the in-memory database +- [UserModule]/user-findall.controller: returns all users from the in-memory database +- [UserModule]/user-update.controller: update a user info from the in-memory database #### Main @@ -177,8 +175,8 @@ The `main.ts` includes an async function that will bootstrap the ExpressoTS appl ```typescript async function bootstrap() { - const app = await AppFactory.create(container, App); - await app.listen(3000, ServerEnvironment.Development); + const app = await AppFactory.create(container, App); + await app.listen(3000, ServerEnvironment.Development); } bootstrap(); @@ -188,8 +186,8 @@ bootstrap(); ```typescript async function bootstrap() { - const app = await AppFactory.create(container, []); - await app.listen(3000, ServerEnvironment.Development); + const app = await AppFactory.create(container, []); + await app.listen(3000, ServerEnvironment.Development); } bootstrap(); @@ -199,23 +197,23 @@ bootstrap(); To bootstrap an ExpressoTS application, there are two ways: -- Non-opinionated template using the AppFactory to creates an instance of the default ExpressoTS adapter which is the Express.js. User can directly pass an array of middleware to the `AppFactory.create` method, which will be responsible for creating an Expressjs application with the provided middleware. This method of creating an ExpressoTS application exposes the Expressjs application instance, which can be used to add additional middleware or to configure the Expressjs application. +- Non-opinionated template using the AppFactory to creates an instance of the default ExpressoTS adapter which is the Express.js. User can directly pass an array of middleware to the `AppFactory.create` method, which will be responsible for creating an Expressjs application with the provided middleware. This method of creating an ExpressoTS application exposes the Expressjs application instance, which can be used to add additional middleware or to configure the Expressjs application. ```typescript async function bootstrap() { - const app = await AppFactory.create(container, [cors(), helmet()]); - await app.listen(3000, ServerEnvironment.Development); + const app = await AppFactory.create(container, [cors(), helmet()]); + await app.listen(3000, ServerEnvironment.Development); } bootstrap(); ``` -- Opinionated template using the AppFactory to create an AppExpress application. By using the App (AppExpress) class, you can take advantage of its built-in mechanisms for controlling the **[application life cycle hooks](application.md#application-lifecycle-hooks)**, such as injecting and executing services before, after, and during application shutdown. +- Opinionated template using the AppFactory to create an AppExpress application. By using the App (AppExpress) class, you can take advantage of its built-in mechanisms for controlling the **[application life cycle hooks](application.md#application-lifecycle-hooks)**, such as injecting and executing services before, after, and during application shutdown. ```typescript async function bootstrap() { - const app = await AppFactory.create(container, App); - await app.listen(3000, ServerEnvironment.Development); + const app = await AppFactory.create(container, App); + await app.listen(3000, ServerEnvironment.Development); } bootstrap(); @@ -242,8 +240,8 @@ Read more about the modules in the **[Modules](module.md)** section. const appContainer = new AppContainer(); const container: Container = appContainer.create([ - // Add your modules here - AppModule, + // Add your modules here + AppModule, ]); ``` @@ -253,8 +251,8 @@ The controller layer handles incoming requests and returns appropriate responses ```typescript const AppModule: ContainerModule = CreateModule([ - // Add your controllers here - AppController, + // Add your controllers here + AppController, ]); ``` @@ -302,9 +300,9 @@ ExpressoTS is a versatile framework that is not bound to any specific platform o ExpressoTS is an MIT-licensed open source project. It's an independent project with ongoing development made possible thanks to your support. If you'd like to help, please consider: -- Become a **[sponsor on GitHub](https://github.com/sponsors/expressots)** -- Follow the **[organization](https://github.com/expressots)** on GitHub and Star ⭐ the project -- Subscribe to the Twitch channel: **[Richard Zampieri](https://www.twitch.tv/richardzampieri)** -- Join our **[Discord](https://discord.com/invite/PyPJfGK)** -- Contribute submitting **[issues and pull requests](https://github.com/expressots/expressots/issues/new/choose)** -- Share the project with your friends and colleagues +- Become a **[sponsor on GitHub](https://github.com/sponsors/expressots)** +- Follow the **[organization](https://github.com/expressots)** on GitHub and Star ⭐ the project +- Subscribe to the Twitch channel: **[Richard Zampieri](https://www.twitch.tv/richardzampieri)** +- Join our **[Discord](https://discord.com/invite/PyPJfGK)** +- Contribute submitting **[issues and pull requests](https://github.com/expressots/expressots/issues/new/choose)** +- Share the project with your friends and colleagues diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/overview/controller.md b/i18n/pt/docusaurus-plugin-content-docs/current/overview/controller.md index 866c1085..902794f2 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/overview/controller.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/overview/controller.md @@ -45,20 +45,19 @@ Como resultado, os DTOs ajudam a segregar e filtrar os dados enviados ao cliente ## Classe Controller -A classe controller no ExpressoTS representa o endpoint que você deseja criar para a sua aplicação. Você pode definir a rota e o método HTTP para o controller usando o decorador `@controller()` do [Inversify Express Utils package](https://github.com/inversify/inversify-express-utils). +A classe controller no ExpressoTS representa o endpoint que você deseja criar para a sua aplicação. Você pode definir a rota e o método HTTP para o controller usando o decorador `@controller()` do [Decorator section](./decorators.md). -Cada classe de controlador contém um único método chamado `execute()` que manipula a solicitação e envia a resposta. Este método é anotado **[@httpMethods()](./decorators.md)** com decorador do mesmo pacote Inversify. Adicionalmente os parâmetros do método `execute()` pode também ser anotados. +Cada classe de controlador contém um único método chamado `execute()` que manipula a solicitação e envia a resposta. Este método é anotado **[http methods()](./decorators.md#decoradores-de-métodos-http)** com decorador do mesmo pacote Inversify. Adicionalmente os parâmetros do método `execute()` pode também ser anotados. Aqui está um exemplo de uma classe de controlador ExpressoTS: ```typescript @controller("/") class AppController { - - @httpGet("/") - execute(@response() res: any) { - return res.send("Hello from ExpressoTS!"); - } + @httpGet("/") + execute(@response() res: any) { + return res.send("Hello from ExpressoTS!"); + } } ``` @@ -84,9 +83,9 @@ Esta é a assinatura do método `callUseCase`: callUseCase(useCase: any, res: any, successStatusCode: number); ``` -- `useCase`: O caso de uso a ser chamado. O caso de uso é injetado no construtor do controler. -- `res`: O objeto resposta do tipe express Response. -- `successStatusCode`: O código de status indica o resultado da solicitação HTTP e é enviado ao cliente quando o caso de uso é executado com êxito. Para mais informações sobre Status code visite **[Http Status Code](./status-code.md)**. +- `useCase`: O caso de uso a ser chamado. O caso de uso é injetado no construtor do controler. +- `res`: O objeto resposta do tipe express Response. +- `successStatusCode`: O código de status indica o resultado da solicitação HTTP e é enviado ao cliente quando o caso de uso é executado com êxito. Para mais informações sobre Status code visite **[Http Status Code](./status-code.md)**. Resposta padrão: @@ -99,17 +98,14 @@ Um exemplo mais completo de uma classe de controlador que herda da classe BaseCo ```typescript @controller("/") class AppController extends BaseController { - constructor(private appUseCase: AppUseCase) { - super("app-controller"); - } - - @httpGet("/") - execute(@response() res: any): IAppResponseDTO { - return this.callUseCase(this.appUseCase.execute(), - res, - StatusCode.OK - ); - } + constructor(private appUseCase: AppUseCase) { + super("app-controller"); + } + + @httpGet("/") + execute(@response() res: any): IAppResponseDTO { + return this.callUseCase(this.appUseCase.execute(), res, StatusCode.OK); + } } ``` @@ -127,7 +123,7 @@ Aqui está um exemplo de uso: ```typescript @scope(BindingScopeEnum.Singleton) @controller("/") -class CreateUserController extends BaseController { } +class CreateUserController extends BaseController {} ``` O controlador acima terá o escopo de `Singleton` e será compartilhado entre todas as solicitações. @@ -140,30 +136,30 @@ Os decoradores de métodos HTTP e parâmetros são um conjunto de anotações us Aqui está uma lista de todos os decoradores `@httpMethods()` disponíveis no ExpressoTS, juntamente com sua descrição e uso: -| Decorador | Descrição | Uso | -| ----------- | ------------------------------------------------------------------ | ---------------------------- | -| @httpGet | Vincula um método de controlador a um verbo HTTP GET. | @httpGet("/path") | -| @httpPost | Vincula um método de controlador a um verbo HTTP POST. | @httpPost("/path") | -| @httpPut | Vincula um método de controlador a um verbo HTTP PUT. | @httpPut("/path") | -| @httpPatch | Vincula um método de controlador a um verbo HTTP PATCH. | @httpPatch("/path") | -| @httpHead | Vincula um método de controlador a um verbo HTTP HEAD. | @httpHead("/path") | -| @httpDelete | Vincula um método de controlador a um verbo HTTP DELETE. | @httpDelete("/path") | -| @httpMethod | Vincula um método de controlador a um verbo HTTP especificado. | @httpMethod("verb", "/path") | +| Decorador | Descrição | Uso | +| ----------- | -------------------------------------------------------------- | ---------------------------- | +| @httpGet | Vincula um método de controlador a um verbo HTTP GET. | @httpGet("/path") | +| @httpPost | Vincula um método de controlador a um verbo HTTP POST. | @httpPost("/path") | +| @httpPut | Vincula um método de controlador a um verbo HTTP PUT. | @httpPut("/path") | +| @httpPatch | Vincula um método de controlador a um verbo HTTP PATCH. | @httpPatch("/path") | +| @httpHead | Vincula um método de controlador a um verbo HTTP HEAD. | @httpHead("/path") | +| @httpDelete | Vincula um método de controlador a um verbo HTTP DELETE. | @httpDelete("/path") | +| @httpMethod | Vincula um método de controlador a um verbo HTTP especificado. | @httpMethod("verb", "/path") | ### Decoradores de parâmetros Aqui está uma lista de todos os decoradores de parâmetros disponíveis no ExpressoTS, juntamente com sua descrição e uso: -| Decorator | Descrição | Uso -| ------------------------------------ | ------------------------------------------------------ | -------------------------------------------------------- | -| @request() | Injeta objeto Express Request. | execute(@request() req: Request) -| @response() | Injeta objeto Express Response. | execute(@response() res: Response) -| @requestParam(paramName?: string) | Injeta um parâmetro da URL da solicitação. | execute(@requestParam('id') id: string) -| @queryParam(paramName?: string) | Injeta um parâmetro da string de consulta da URL da solicitação. | execute(@queryParam('searchTerm') searchTerm: string) -| @requestBody() | Injeta a carga útil do corpo da solicitação. | execute(@requestBody() body: MyDTO) -| @requestHeaders(headerName?: string) | Injeta um cabeçalho dos cabeçalhos da solicitação. | execute(@requestHeaders('authorization') auth: string) -| @cookies(cookieName?: string) | Injeta um cookie dos cookies da solicitação. | execute(@cookies('session') session: string) -| @next() | Injeta o objeto NextFunction do Express. | execute(@next() next: NextFunction) +| Decorator | Descrição | Uso | +| ------------------------------------ | ---------------------------------------------------------------- | ------------------------------------------------------ | +| @request() | Injeta objeto Express Request. | execute(@request() req: Request) | +| @response() | Injeta objeto Express Response. | execute(@response() res: Response) | +| @requestParam(paramName?: string) | Injeta um parâmetro da URL da solicitação. | execute(@requestParam('id') id: string) | +| @queryParam(paramName?: string) | Injeta um parâmetro da string de consulta da URL da solicitação. | execute(@queryParam('searchTerm') searchTerm: string) | +| @requestBody() | Injeta a carga útil do corpo da solicitação. | execute(@requestBody() body: MyDTO) | +| @requestHeaders(headerName?: string) | Injeta um cabeçalho dos cabeçalhos da solicitação. | execute(@requestHeaders('authorization') auth: string) | +| @cookies(cookieName?: string) | Injeta um cookie dos cookies da solicitação. | execute(@cookies('session') session: string) | +| @next() | Injeta o objeto NextFunction do Express. | execute(@next() next: NextFunction) | ## Uma abordagem MVC @@ -174,30 +170,30 @@ Aqui está um exemplo de uso da abordagem MVC, que contém uma única classe con ```typescript @controller("/product") class ProductController { - @httpPost("/") - create(@response() res: any) { - return res.status(201).json({ message: "Product created" }); - } - - @httpGet("/") - list(@response() res: any) { - return res.status(200).json({ message: "Product listed" }); - } - - @httpGet("/:id") - get(@response() res: any) { - return res.status(200).json({ message: "Product get" }); - } - - @httpPatch("/:id") - update(@response() res: any) { - return res.status(200).json({ message: "Product updated" }); - } - - @httpDelete("/:id") - delete(@response() res: any) { - return res.status(200).json({ message: "Product deleted" }); - } + @httpPost("/") + create(@response() res: any) { + return res.status(201).json({ message: "Product created" }); + } + + @httpGet("/") + list(@response() res: any) { + return res.status(200).json({ message: "Product listed" }); + } + + @httpGet("/:id") + get(@response() res: any) { + return res.status(200).json({ message: "Product get" }); + } + + @httpPatch("/:id") + update(@response() res: any) { + return res.status(200).json({ message: "Product updated" }); + } + + @httpDelete("/:id") + delete(@response() res: any) { + return res.status(200).json({ message: "Product deleted" }); + } } ``` @@ -207,9 +203,9 @@ class ProductController { ExpressoTS é um projeto de código aberto licenciado sob o MIT. É um projeto independente com desenvolvimento contínuo possibilitado graças ao seu suporte. Se você deseja ajudar, por favor considere: -- Se tornar um **[Sponsor no GitHub](https://github.com/sponsors/expressots)** -- Siga a **[organização](https://github.com/expressots)** no GitHub e de um Star ⭐ no projeto -- Subscreva no nosso canal na Twitch: **[Richard Zampieri](https://www.twitch.tv/richardzampieri)** -- Entre no nosso **[Discord](https://discord.com/invite/PyPJfGK)** -- Contribua submetendo **[issues e pull requests](https://github.com/expressots/expressots/issues/new/choose)** -- Compartilhe o projeto com seus amigos e colegas \ No newline at end of file +- Se tornar um **[Sponsor no GitHub](https://github.com/sponsors/expressots)** +- Siga a **[organização](https://github.com/expressots)** no GitHub e de um Star ⭐ no projeto +- Subscreva no nosso canal na Twitch: **[Richard Zampieri](https://www.twitch.tv/richardzampieri)** +- Entre no nosso **[Discord](https://discord.com/invite/PyPJfGK)** +- Contribua submetendo **[issues e pull requests](https://github.com/expressots/expressots/issues/new/choose)** +- Compartilhe o projeto com seus amigos e colegas diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/overview/first-steps.md b/i18n/pt/docusaurus-plugin-content-docs/current/overview/first-steps.md index f5d51cfe..721253ae 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/overview/first-steps.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/overview/first-steps.md @@ -10,15 +10,15 @@ Nesta seção, você vai mergulhar nos conceitos centrais do ExpressoTS para se Acreditamos no poder de linguagens fortemente tipadas, e o **[TypeScript](https://www.typescriptlang.org/)** é essencial quando se trata de estruturar ou construir aplicações em larga escala em **[NodeJS](https://nodejs.org/)**. No exemplo a seguir, usaremos principalmente TypeScript, e aqui estão as razões pelas quais usamos TypeScript: -- Melhoria da qualidade do código: Tipagem forte ajuda a pegar erros e bugs em tempo de compilação, ao invés de em tempo de execução, o que ajuda a melhorar a qualidade geral do código. Isso pode levar a menos falhas e problemas com o código em produção. +- Melhoria da qualidade do código: Tipagem forte ajuda a pegar erros e bugs em tempo de compilação, ao invés de em tempo de execução, o que ajuda a melhorar a qualidade geral do código. Isso pode levar a menos falhas e problemas com o código em produção. -- Melhor escalabilidade: A tipagem forte pode ajudar a tornar o código mais escalável, permitindo refatorações e manutenções mais fáceis. Isso ocorre porque a tipagem forte garante que as alterações no código sejam consistentes e previsíveis, tornando mais fácil adicionar novos recursos ou modificar os existentes. +- Melhor escalabilidade: A tipagem forte pode ajudar a tornar o código mais escalável, permitindo refatorações e manutenções mais fáceis. Isso ocorre porque a tipagem forte garante que as alterações no código sejam consistentes e previsíveis, tornando mais fácil adicionar novos recursos ou modificar os existentes. -- Aumento da produtividade: A tipagem forte pode aumentar a produtividade do desenvolvedor, fornecendo melhores ferramentas e suporte do editor, como conclusão de código, inferência de tipo e refatoração automática. Isso pode ajudar os desenvolvedores a escrever código mais rápido e com menos erros. +- Aumento da produtividade: A tipagem forte pode aumentar a produtividade do desenvolvedor, fornecendo melhores ferramentas e suporte do editor, como conclusão de código, inferência de tipo e refatoração automática. Isso pode ajudar os desenvolvedores a escrever código mais rápido e com menos erros. -- Melhoria da colaboração: A tipagem forte pode facilitar a colaboração entre desenvolvedores, fornecendo um entendimento compartilhado dos tipos e interfaces usados no código-fonte. Isso pode ajudar a reduzir mal-entendidos e inconsistências e tornar mais fácil para os desenvolvedores trabalharem juntos no mesmo código-fonte. +- Melhoria da colaboração: A tipagem forte pode facilitar a colaboração entre desenvolvedores, fornecendo um entendimento compartilhado dos tipos e interfaces usados no código-fonte. Isso pode ajudar a reduzir mal-entendidos e inconsistências e tornar mais fácil para os desenvolvedores trabalharem juntos no mesmo código-fonte. -- Melhor documentação: A tipagem forte pode ajudar a tornar o código auto-documentado, fornecendo uma descrição clara e concisa dos tipos e interfaces usados no código. Isso pode ajudar a reduzir a necessidade de comentários extensos e documentação, tornando o código mais fácil de entender e manter. +- Melhor documentação: A tipagem forte pode ajudar a tornar o código auto-documentado, fornecendo uma descrição clara e concisa dos tipos e interfaces usados no código. Isso pode ajudar a reduzir a necessidade de comentários extensos e documentação, tornando o código mais fácil de entender e manter. ## Pre-requisito @@ -47,9 +47,9 @@ expressots new -t