Skip to content

buraksaraloglu/movie-service

Repository files navigation

Movie Service

Movie Service is a microservice that provides a REST API for movies.

Dependencies

Installation

git clone https://github.com/buraksaraloglu/movie-service.git
cd movie-service
npm install

Development

npm dev

Deployment

npm run build

Usage

npm start

Testing

npm test

Example Requests

Get All Movies

# GET /movie

curl --location --request GET '<service-uri>/movie' \
  --header 'user: <userId>' \

Get Movie by ID

# GET /movie/:movieId

curl --location --request GET '<service-uri>/movie/:movieId' \
  --header 'user: <userId>' \

Create Movie

# POST /movie

curl --location --request POST '<service-uri>/movie' \
  --header 'Content-Type: application/json' \
  --header 'user: <userId>' \
  --data-raw '{
    "name": "Titanic",
    "releaseDate": "1997-12-19"
  }'

Update Movie

# PUT /movie

curl --location --request PUT '<service-uri>/movie' \
  --header 'Content-Type: application/json' \
  --header 'user: <userId>' \
  --data-raw '{
    "name": "Titanic",
    "releaseDate": "2022-12-19"
  }'

About

A movie service example built with TypeScript, Express, MongoDB

Resources

License

Stars

Watchers

Forks