Skip to content

Backend: API Rest Server, Practice for Node.js, Express.js and PostgreSQL

Notifications You must be signed in to change notification settings

JayroGG/ApiRestPSQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Server

This is an API server that provides routes to get, post, update and delete movies from a PostgreSQL database.

Prerequisites

To use this API server, you will need the following:

  • Node.js installed
  • A PostgreSQL database running

Getting Started

  1. Clone this repository to your local machine
  2. Install dependencies by running npm install
  3. Create a .env file in the root directory of the project with the following variables:
  
makefile Copy code
ORIGIN=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
  1. Start the API server by running npm start

Usage

Once the API server is running, you can use the following endpoints:

  • GET /movies: Returns a list of all movies in the database
  • GET /movies/:title: Returns a list of movies that match the given title
  • POST /movies: Adds a new movie to the database
  • PUT /movies/:id: Updates the movie with the given id
  • DELETE /movies/:id: Deletes the movie with the given id

License

This project is licensed under the MIT License.

About

Backend: API Rest Server, Practice for Node.js, Express.js and PostgreSQL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages