This project is a REST API for managing a list of movies, built with Next.js.
-
Clone the repository (if you haven't already):
git clone <repository-url> cd <repository-directory>
-
Install dependencies: Open your terminal in the project root directory and run:
npm install
To start the development server, run:
npm run dev
This will typically start the server on http://localhost:3000
. You can open this URL in your browser to see the application. The frontend page at /
will display the list of movies.
To create a production-ready build, run:
npm run build
This command compiles the Next.js application into an optimized static build in the .next
folder.
After building the application, you can start the production server with:
npm run start
This will serve the optimized build, typically on http://localhost:3000
.
The application provides the following API endpoints:
GET /api/movies
: Retrieves a list of all movies.POST /api/movies
: Adds a new movie to the list.- Request body example:
{ "title": "New Movie Title", "director": "Director Name", "release_date": "YYYY-MM-DD" }
- Request body example:
GET /api/movies/:id
: Retrieves a specific movie by its ID.DELETE /api/movies/:id
: Deletes a specific movie by its ID.
To run the linter, use:
npm run lint