This is an API server that provides routes to get, post, update and delete movies from a PostgreSQL database.
To use this API server, you will need the following:
- Node.js installed
- A PostgreSQL database running
- Clone this repository to your local machine
- Install dependencies by running
npm install
- Create a
.env
file in the root directory of the project with the following variables:
makefile Copy codeORIGIN=http://localhost:3000 APP_PORT=3000 DB_HOST=localhost DB_PORT=5432 DB_NAME=your_database_name DB_USER=your_database_user DB_PASSWORD=your_database_password
- Start the API server by running
npm start
Once the API server is running, you can use the following endpoints:
GET /movies
: Returns a list of all movies in the databaseGET /movies/:title
: Returns a list of movies that match the given titlePOST /movies
: Adds a new movie to the databasePUT /movies/:id
: Updates the movie with the given idDELETE /movies/:id
: Deletes the movie with the given id
This project is licensed under the MIT License.