Skip to content

Commit 3c2de9c

Browse files
1 parent b6ddc18 commit 3c2de9c

File tree

8 files changed

+108
-72
lines changed

8 files changed

+108
-72
lines changed

.github/mlc_config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
{
2525
"pattern": "^/.github",
2626
"replacement": "https://github.com/PauloGoncalvesBH/ServeRest/tree/trunk/.github"
27+
},
28+
{
29+
"pattern": "https://api.serverest.dev",
30+
"replacement": "https://api.serverest.dev/usuarios?nome=check-link"
2731
}
2832
]
2933
}

.github/workflows/continuous_delivery.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,24 @@ jobs:
7171
node-version: 12
7272
- name: Installation of Node.js dependencies
7373
run: npm ci
74-
- name: Release
74+
- name: Release on NPM and Docker
7575
env:
7676
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
7777
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7878
DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
7979
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
8080
run: npx semantic-release
81+
- name: Project checkout
82+
uses: actions/checkout@v2
83+
with:
84+
fetch-depth: 2
85+
- name: Setup SSH to use on 'git push umbler'
86+
uses: shimataro/[email protected]
87+
with:
88+
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
89+
public-key: ${{ secrets.SSH_PUBLIC_KEY }}
90+
known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
91+
- name: Release on api.serverest.dev
92+
run: |
93+
git remote add umbler ssh://[email protected]:9922/jnydrgre/api-serverest-dev.git
94+
git push umbler trunk:trunk --no-verify

.github/workflows/deploy-docs-serverest-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ jobs:
1818
with:
1919
ftp-server: geonosis02.umbler.host
2020
ftp-username: serverest-dev
21-
ftp-password: ${{ secrets.FTP_PASSWORD }}
21+
ftp-password: ${{ secrets.FTP_PASSWORD_DOC }}
2222
local-dir: docs

README.md

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,23 @@
11

22
<h1 align="center">ServeRest</h1>
33

4-
<i><h4 align="center">Servidor REST local de forma rápida e simples para estudo de testes de API</h5></i>
4+
<i><h4 align="center">Servidor REST local de forma rápida e simples para estudo de testes de API</h4></i>
55

66
<p align="center">
77
<a href="https://npmjs.com/package/serverest"><img alt="serverest version" src="https://img.shields.io/npm/v/serverest?style=for-the-badge"></a>
88
<a href="https://hub.docker.com/r/paulogoncalvesbh/serverest"><img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/paulogoncalvesbh/serverest?style=for-the-badge"></a>
9-
<a href="https://codecov.io/gh/PauloGoncalvesBH/ServeRest"><img alt="Codecov branch" src="https://img.shields.io/codecov/c/github/PauloGoncalvesBH/ServeRest/trunk?style=for-the-badge"></a>
10-
<a href="https://npm-stat.com/charts.html?package=serverest"><img alt="serverest total downloads" src="https://img.shields.io/npm/dt/serverest?style=for-the-badge"></a>
9+
<a href="https://opencollective.com/serverest"><img alt="Quantidade de doadores" src="https://img.shields.io/opencollective/all/serverest?color=orange&label=Doadores%20%24&style=for-the-badge"></a>
10+
<a href="https://npm-stat.com/charts.html?package=serverest"><img alt="serverest total downloads" src="https://img.shields.io/npm/dt/serverest?color=blue&style=for-the-badge"></a>
1111
</p>
1212

1313
<p align="center">
1414
<b>
15-
<a href="https://serverest.dev">Documentação das rotas</a> |
1615
<a href="https://github.com/PauloGoncalvesBH/ServeRest/blob/trunk/.github/CODE_OF_CONDUCT.md">Código de conduta</a> |
1716
<a href="https://github.com/PauloGoncalvesBH/ServeRest/blob/trunk/.github/CONTRIBUTING.md">Como contribuir</a> |
1817
<a href="https://github.com/PauloGoncalvesBH/ServeRest/blob/trunk/CHANGELOG.md">Histórico de alterações</a>
1918
</b>
2019
</p>
2120

22-
<p align="center">
23-
<img alt="Print do ServeRest iniciado no terminal" src="https://user-images.githubusercontent.com/29241659/95020650-bb01d600-0642-11eb-80dc-21bd69d80a15.png" height="200">
24-
</p>
25-
26-
## Inicializar o ServeRest
27-
28-
### Com Node
29-
30-
Para iniciar o _ServeRest_ execute o seguinte comando no terminal:
31-
32-
```sh
33-
npx serverest@latest
34-
```
35-
36-
Não é preciso fazer instalação com `npm install` antes da execução.
37-
38-
### Com Docker
39-
40-
Você também pode executar o _ServeRest_ com o docker, utilizando o seguinte comando no terminal:
41-
42-
```sh
43-
docker run -p 3000:3000 paulogoncalvesbh/serverest:latest
44-
```
45-
46-
---
47-
4821
_ServeRest_ permite o estudo de:
4922
- Verbos *GET, POST, PUT* e *DELETE*
5023
- Autenticação no header
@@ -53,9 +26,11 @@ _ServeRest_ permite o estudo de:
5326
- Contrato
5427
- Requisições aninhadas
5528

56-
## Documentação
29+
<b><i><h3 align="center">Acessse <https://api.serverest.dev> para ter acesso às rotas disponibilizadas pelo ServeRest</h3></i></b>
30+
31+
## Documentação das rotas
5732

58-
Acesse **[serverest.dev](https://serverest.dev)** para ter acesso a documentação de todas as rotas, verbos, contratos e respostas possíveis.
33+
Acesse **<https://serverest.dev>** para visualizar a documentação de todas as rotas, verbos, contratos e respostas possíveis.
5934

6035
<details><summary><i>Abra para ver imagem resumida das rotas disponíveis</i></summary>
6136

@@ -65,7 +40,25 @@ Acesse **[serverest.dev](https://serverest.dev)** para ter acesso a documentaç
6540

6641
</details>
6742

68-
A documentação é aberta automaticamente ao iniciar o _ServeRest_. Para evitar o início automático envie o comando `npx serverest --nodoc`.
43+
## Executar o ServeRest localmente
44+
45+
É possível utilizar de forma local em _localhost:3000_, o que pode ser útil caso precise que os dados não sejam alterados por outros usuários.
46+
47+
<p align="center">
48+
<img alt="Print do ServeRest iniciado no terminal" src="https://user-images.githubusercontent.com/29241659/96160448-5bca7e00-0eec-11eb-94d7-8222311e34c4.png" height="190">
49+
</p>
50+
51+
### Utilizando NPM
52+
53+
Execute o seguinte comando no terminal:
54+
55+
```sh
56+
npx serverest@latest
57+
```
58+
59+
> Não é preciso fazer instalação com `npm install` antes da execução.
60+
61+
<details><summary><i>Abra para ver detalhes de configuração do ServeRest com NPM</i></summary>
6962

7063
## Configuração
7164

@@ -96,6 +89,24 @@ Utilize esse comportamento nos seus testes, validando a presença/ausência dess
9689

9790
> Para saber mais leia o [checklist de segurança de API](https://github.com/shieldfy/API-Security-Checklist#api-security-checklist)
9891
92+
---
93+
94+
</details>
95+
96+
### Utilizando Docker
97+
98+
Execute o seguinte comando no terminal:
99+
100+
```sh
101+
docker run -p 3000:3000 paulogoncalvesbh/serverest:latest
102+
```
103+
104+
### Executando versão específica
105+
106+
Em ambos os comandos você sempre utilizará a última versão disponível. Caso queira usar uma versão específica basta substituir o `latest` pela versão desejada.
107+
108+
Você pode encontrar as versões disponíveis na [lista de tags no Docker Hub](https://hub.docker.com/r/paulogoncalvesbh/serverest/tags) e na [lista de versões do NPM](https://www.npmjs.com/package/serverest).
109+
99110
## Exemplo de automação
100111

101112
Os repositórios abaixo são bons exemplos de automação com boas práticas, com CI configurada e que consome o ServeRest.
@@ -117,6 +128,8 @@ Sua empresa (ou projeto) utiliza e quer constar na lista? [Abra uma issue](https
117128

118129
## Apoie o ServeRest
119130

131+
### Dando star no repositório ⭐
132+
120133
### Utilizando badge
121134

122135
Adicione ao README.md do seu repositório o badge do Serverest e demonstre seu apoio ao projeto.
@@ -129,14 +142,14 @@ Adicione ao README.md do seu repositório o badge do Serverest e demonstre seu a
129142

130143
### Fazendo doação
131144

132-
Faça doação única ou mensal a partir de 1 dólar.
145+
Faça doação única ou mensal a partir de 1 dólar e ajude a pagar o domínio e a hospedagem de <https://serverest.dev>.
133146

134147
[![Doação - Open Collective](https://opencollective.com/serverest/tiers/doacao-recorrente.svg)](https://opencollective.com/serverest)
135148

136149
## Contributors ✨
137150

138151
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
139-
![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=for-the-badge)
152+
![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?color=blue&style=for-the-badge)
140153
<!-- ALL-CONTRIBUTORS-BADGE:END -->
141154

142155
Obrigado a essas pessoas incríveis ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

docs/index.html

Lines changed: 27 additions & 30 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 11 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if (!conf.semHeaderDeSeguranca) {
3838
})
3939
}
4040

41-
app.get('/favicon.ico', (req, res) => { res.sendStatus(200) })
41+
app.get('/favicon.ico', (req, res) => { res.sendStatus(204) })
4242

4343
monitor(app)
4444

test/outros/generico.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('GENERICO', () => {
2525
it('/favicon.ico', async () => {
2626
const { body } = await request
2727
.get('/favicon.ico')
28-
.expect(200)
28+
.expect(204)
2929

3030
chai.assert.deepEqual(body, {})
3131
})

0 commit comments

Comments
 (0)