Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lagden committed May 18, 2023
1 parent 2059752 commit 3d66153
Showing 1 changed file with 18 additions and 44 deletions.
62 changes: 18 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Boilerplate para desenvolvimento de uma API REST.
- [Instalação](#instalação)
- [Como utilizar](#como-utilizar)
- [watch](#watch)
- [entr](#entr)
- [nodemon](#nodemon)
- [teste](#teste)
- [Imagem](#imagem)
- [Deploy](#deploy)
Expand All @@ -26,25 +24,20 @@ Boilerplate para desenvolvimento de uma API REST.

## Instalação

Use o [tiged](https://github.com/tiged/tiged) para fazer o `scaffolding` do projeto.

Existem algumas dependências.

- [bin](https://github.com/lagden/boilerplate-bin)
- [envs](https://github.com/lagden/boilerplate-envs)
- [docker](https://github.com/lagden/boilerplate-docker-nodejs) (opcional)
Utilize `@tadashi/boilerplate-create` para iniciar o projeto.

```
npm i -g @tadashi/boilerplate-create
boilerplate-create
```

**Exemplo:**
ou

```shell
npx tiged lagden/boilerplate-rest#main projeto
cd projeto
npx tiged lagden/boilerplate-bin/files#main bin --force
npx tiged lagden/boilerplate-eslint/files/backend#main . --force
npx tiged lagden/boilerplate-envs/files#main .env --force
npx tiged lagden/boilerplate-docker-nodejs/files#main . --force
```
npx --yes @tadashi/boilerplate-create
```

E siga as instruções do prompt.


## Como utilizar
Expand Down Expand Up @@ -85,30 +78,6 @@ bin/docker/start -b
O **watch** reinicia a aplicação caso ocorra alguma alteração.
Rodando via **docker** isso ocorre por padrão, mas **local** é necessário fazer algumas instalações e configurações.


#### entr

Se estiver rodando em **BSD** ou **Mac OS** ou **Linux**, basta instalar o [entr](https://github.com/eradman/entr) e executar:

```shell
bin/local/start -w
```


#### nodemon

Como o [entr](https://github.com/eradman/entr) não roda no **Windows**, existe uma solução alternativa.

Utilize o arquivo `.env-local` na raiz do projeto e insira o código abaixo:

```
WATCH_LOCAL_CMD="yarn dlx nodemon -e js,json --watch server --exec npm start"
```

---

Então, execute o comando:

```shell
bin/local/start -w
```
Expand Down Expand Up @@ -173,15 +142,15 @@ bin/docker/deploy -e production
Chamada de exemplo da API via **curl**.

```shell
curl 'http://[::1]:5000/'
curl 'http://127.0.0.1:5001/'
```

```shell
curl 'http://[::1]:5000/API'
curl 'http://127.0.0.1:5001/API'
```

```shell
curl 'http://[::1]:5000/echo' \
curl 'http://127.0.0.1:5001/echo' \
-H 'content-type: application/json' \
-d '{"apenas": "um show"}'
```
Expand All @@ -198,6 +167,11 @@ Sugestão de outros **middlewares** para serem utilizados no projeto:
- [koa-static](https://github.com/koajs/static)


## Donate ❤️

- BTC: bc1q7famhuj5f25n6qvlm3sssnymk2qpxrfwpyq7g4


## License

MIT © [Thiago Lagden](https://github.com/lagden)

0 comments on commit 3d66153

Please sign in to comment.