-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
155 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"label": "Providers", | ||
"position": 3, | ||
"link": { | ||
"type": "generated-index", | ||
"description": "ExpressoTS Framework Providers." | ||
} | ||
} |
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,49 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Environment validator | ||
|
||
The environment validator provider is a provider that ExpressoTS offers out-of-the-box. It is used to validate the existence of the `.env` file and its content. | ||
It helps the developer to avoid runtime errors caused by missing environment variables. | ||
|
||
:::tip | ||
It is only included in the opinionated template or when you create a class that extends the `Application` class. | ||
::: | ||
|
||
You can find it in the `src/providers/application` folder in the opinionated template. | ||
|
||
The `application.provider` is the main provider of the application that is responsible to control the **[Application Lifecycle](../overview/application.md#application-lifecycle-hooks)**. | ||
|
||
Inside of the Application class you can find three methods that are called in the following order: | ||
|
||
- `configureServices()` : Configure services that should be initialized before the server starts. | ||
- `postServerInitialization()` : Configure services that should be executed after the server starts. | ||
- `serverShutdown()` : Perform actions or cleanup after the server is shutdown. | ||
|
||
Environment validator provider is called in the `configureServices()` method preventing the application to start if the `.env` file is missing or if it has missing environment variables. | ||
|
||
```typescript | ||
protected configureServices(): void { | ||
Environments.checkAll(); | ||
} | ||
``` | ||
|
||
The environment validator provider also has a method called `get()` that returns the value of an environment variable. It is used to get a specific environment variable value passing its name as a parameter. | ||
|
||
```typescript | ||
Environments.get("PORT"); | ||
``` | ||
|
||
--- | ||
|
||
## Support the project | ||
|
||
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 **[Sponsor no 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 |
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,20 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Prisma provider | ||
|
||
Coming soon... | ||
|
||
--- | ||
|
||
## Support the project | ||
|
||
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 **[Sponsor no 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 |
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
8 changes: 8 additions & 0 deletions
8
i18n/pt/docusaurus-plugin-content-docs/current/providers/_category_.json
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,8 @@ | ||
{ | ||
"label": "Provedores", | ||
"position": 3, | ||
"link": { | ||
"type": "generated-index", | ||
"description": "ExpressoTS Framework Provedores." | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
i18n/pt/docusaurus-plugin-content-docs/current/providers/envvalidator.md
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,49 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Validator de ambiente | ||
|
||
O provedor de validação de ambiente é um provedor que o ExpressoTS oferece por padrão. Ele é usado para validar a existência do arquivo `.env` e seu conteúdo. | ||
Ele ajuda o desenvolvedor a evitar erros em tempo de execução causados por variáveis de ambiente ausentes. | ||
|
||
:::tip | ||
Ele está incluso apenas no modelo opinativo ou quando você cria uma classe que estende a classe `Application`. | ||
::: | ||
|
||
Você pode encontrá-lo na pasta `src/providers/application` no modelo opinativo. | ||
|
||
O `application.provider` é o provedor principal do aplicativo responsável por controlar o **[Application Lifecycle](../overview/application.md#application-lifecycle-hooks)**. | ||
|
||
Dentro da classe Application você pode encontrar três métodos que são chamados na seguinte ordem: | ||
|
||
- `configureServices()` : Configura serviços que devem ser inicializados antes do início do servidor. | ||
- `postServerInitialization()` : Configura serviços que devem ser executados após o início do servidor. | ||
- `serverShutdown()` : Realiza ações ou limpezas após o desligamento do servidor. | ||
|
||
O provedor de validação de ambiente é chamado no método `configureServices()`, prevenindo que o aplicativo inicie se o arquivo `.env` estiver faltando ou se tiver variáveis de ambiente ausentes. | ||
|
||
```typescript | ||
protected configureServices(): void { | ||
Environments.checkAll(); | ||
} | ||
``` | ||
|
||
O provedor de validação de ambiente também tem um método chamado `get()` que retorna o valor de uma variável de ambiente. Ele é usado para obter um valor específico de variável de ambiente passando seu nome como parâmetro. | ||
|
||
```typescript | ||
Environments.get("PORT"); | ||
``` | ||
|
||
--- | ||
|
||
## Apoie o projeto | ||
|
||
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 |
20 changes: 20 additions & 0 deletions
20
i18n/pt/docusaurus-plugin-content-docs/current/providers/prisma.md
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,20 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Prisma provedor | ||
|
||
Em breve... | ||
|
||
--- | ||
|
||
## Apoie o projeto | ||
|
||
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 |