This is created to securely interact with the external API The Movie Database. It provides endpoints to fetch data, search for data, and fetch details.
Accordingly, instead of exposing the API key to the client, the server will handle the requests and responses to the external API. This way, the API key is kept secure and the client can still access the data.
You can see the corresponding client code here.
- Clone the repository.
- Run
npm install
to install the dependencies. - Create a
.env
file in the root directory and set the following environment variables:API_URL
: The base URL of the external API.API_KEY
: Your API key for the external API.PORT
: The port number for the Express server (optional).- Get your variables developer.themoviedb.org
- Run
npm start
to start the server.
Fetches data from the external API based on the type
and status
parameters.
Searches content type, movies, tv, via external API based on the type
parameter and the query
and page
query parameters.
Fetches content details from the external API based on the type
and id
parameters.
If an error occurs during a request, the server will respond with a 500 status code and a message of 'Something broke!'.