Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anjasfedo/express-typescript
RESTful API SQLite One to Many on Express.js with Typescript & Prisma.
https://github.com/anjasfedo/express-typescript
expressjs learning-by-doing onetomany prisma rest-api sqlite
Last synced: about 20 hours ago
JSON representation
RESTful API SQLite One to Many on Express.js with Typescript & Prisma.
- Host: GitHub
- URL: https://github.com/anjasfedo/express-typescript
- Owner: Anjasfedo
- Created: 2024-01-13T00:03:16.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-01-13T16:41:00.000Z (10 months ago)
- Last Synced: 2024-04-17T03:32:14.267Z (7 months ago)
- Topics: expressjs, learning-by-doing, onetomany, prisma, rest-api, sqlite
- Language: TypeScript
- Homepage:
- Size: 38.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express TypeScript CRUD API
This project is a simple RESTful API built using Express.js, TypeScript, and Prisma, implementing CRUD operations (Create, Read, Update, Delete).
## Getting Started
Follow these steps to run the project locally:
1. **Install Dependencies:**
```bash
npm install
```2. **Create database:**
```bash
npx prisma db push
```3. **Run database seed:**
```bash
npx prisma db seed
```4. **Start development server:**
```bash
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.
## API Endpoints
### Author:
- 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### Book:
- 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 IDThe API Postman Collection is available in the /postman-collection/ directory.
## Closing Notes
If you find any issues or have suggestions for improvement, please feel free to open an issue or submit a pull request.
Happy coding!