This project is a simple implementation of a CRUD API using the Go programming language and a PostgreSQL database. The database is run inside a Docker container to simplify the development environment and deployment.
Before getting started, make sure you have the following components installed:
- Docker: https://www.docker.com/
- Go: https://golang.org/
- Clone the project repository
git clone https://github.com/mariobenissimo/RestApiPost.git
- Navigate to the project directory:
cd crud
- Start the Docker container for the PostgreSQL database:
cd deployments docker compose up
- Start the Go application:
cd cmd go mod run .
- The application will be running at http://localhost:8000. You can use a tool like cURL or Postman to send requests to the API.
- GET /movies: Returns a list of all movies in the database.
- GET /movies/{id}: Returns the details of a specific movie based on the ID.
- POST /movies: Creates a new movie in the database.
- PUT /movies/{id}: Updates the details of an existing movie based on the ID.
- DELETE /movies/{id}: Delete a movie from the database based on the ID.