This project is a simple RESTful API built using Express.js, TypeScript, and Prisma, implementing CRUD operations (Create, Read, Update, Delete).
Follow these steps to run the project locally:
- Install Dependencies:
npm install
- Create database:
npx prisma db push
- Run database seed:
npx prisma db seed
- Start development server:
npm run dev
These steps will install the necessary dependencies, create the database schema, seed the database with initial data, and start the development server on port 8000.
- GET /api/author: Retrieve all author.
- GET /api/author/:id: Retrieve an author by ID.
- POST /api/author: Create a new author.
- PUT /api/author/:id: Update an author by ID.
- DELETE /api/author/:id: Delete an author by ID
- GET /api/book: Retrieve all book.
- GET /api/book/:id: Retrieve an book by ID.
- POST /api/book: Create a new book.
- PUT /api/book/:id: Update an book by ID.
- DELETE /api/book/:id: Delete an book by ID
The API Postman Collection is available in the /postman-collection/ directory.
If you find any issues or have suggestions for improvement, please feel free to open an issue or submit a pull request.
Happy coding!