diff --git a/README.md b/README.md index 3c2f73b..7f8e6fc 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,18 @@ 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: + - Enter the folder `scripts`: + ```bash + cd scripts + ``` + - Using Docker (Linux): ```bash - ./scripts/docker_run.sh + ./docker_run.sh ``` - Without Docker (Linux): ```bash - ./scripts/main_run.sh + ./compiler.sh --run ``` 5. Access the API at http://localhost:8080 diff --git a/scripts/build.sh b/scripts/build.sh deleted file mode 100644 index 00b3a8a..0000000 --- a/scripts/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -cd .. - -set -e - -mkdir -p bin - -gcc -o bin/main src/main.c -lmicrohttpd -I/usr/include/postgresql -L/usr/lib/x86_64-linux-gnu -lpq diff --git a/scripts/compiler.sh b/scripts/compiler.sh new file mode 100644 index 0000000..5ea13e0 --- /dev/null +++ b/scripts/compiler.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd .. + +set -e + +mkdir -p bin + +gcc -o bin/main src/*.c -lmicrohttpd -I/usr/include/postgresql -L/usr/lib/x86_64-linux-gnu -lpq + +if [[ "$1" == "--run" ]]; then + echo "Executando a aplicação..." + ./bin/main +fi \ No newline at end of file diff --git a/scripts/main_run.sh b/scripts/main_run.sh deleted file mode 100644 index 9bb1cd2..0000000 --- a/scripts/main_run.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e - -./build.sh - -echo "Executando o programa..." - -../bin/main