Skip to content

Commit

Permalink
feat: Add scripts folder for build and run scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroFnseca committed Jul 30, 2024
1 parent 91851d4 commit ae6ccf4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 17 deletions.
9 changes: 2 additions & 7 deletions README-PT.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,14 @@ Neste projeto, estou usando um banco de dados Postgres para armazenar informaç
- Atualize as variáveis com suas credenciais de banco de dados.

4. Executando o Servidor:
- Usando Docker:
- Usando Docker (Linux):
```bash
docker build -t rest-api-c .
docker run -d -p 8080:80 --name rest-api-c rest-api-c
./docker_run.sh
```
- Sem Docker (Linux):
```bash
./main_run.sh
```
- Sem Docker (Windows):
```bash
./main_run.bat
```
5. Acesse o servidor em `http://localhost:8080/` no seu navegador.

## Endpoints
Expand Down
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,13 @@ In this project, I'm using a Postgres database to store user information. The da
- Update the variables with your database credentials.

4. Running the Server:
- Using Docker:
- Using Docker (Linux):
```bash
docker build -t rest-api-c .
docker run -d -p 8080:80 --name rest-api-c rest-api-c
./scripts/docker_run.sh
```
- Without Docker (Linux):
```bash
./main_run.sh
```
- Without Docker (Windows):
```bash
make
./bin/main
./scripts/main_run.sh
```

5. Access the API at http://localhost:8080
Expand Down
Binary file modified bin/main
Binary file not shown.
1 change: 1 addition & 0 deletions build.sh → scripts/build.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
cd ..

set -e

Expand Down
2 changes: 2 additions & 0 deletions docker_run.sh → scripts/docker_run.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

cd ..

CONTAINER_NAME="rest-api-c"

docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1
Expand Down
2 changes: 1 addition & 1 deletion main_run.sh → scripts/main_run.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ set -e

echo "Executando o programa..."

./bin/main
../bin/main

0 comments on commit ae6ccf4

Please sign in to comment.