Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trasherdk/prisma-express-rest-api
Prisma Express REST API with Validation
https://github.com/trasherdk/prisma-express-rest-api
Last synced: 9 days ago
JSON representation
Prisma Express REST API with Validation
- Host: GitHub
- URL: https://github.com/trasherdk/prisma-express-rest-api
- Owner: trasherdk
- Created: 2022-02-19T09:36:08.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-04T07:03:11.000Z (almost 2 years ago)
- Last Synced: 2023-03-03T21:09:43.431Z (over 1 year ago)
- Homepage:
- Size: 270 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Prisma Express REST API Example
## Installation
```sh
# Install deps
$ yarn# Migrate
$ npx prisma migrate save --name init --experimental
$ npx prisma migrate up --experimental# Generate Prisma client
$ npx prisma generate
```## Development
```sh
$ yarn dev
```## Build
```sh
$ yarn build
```## Using the REST API
### `GET`
- `/users`: Fetch all users
- `/users/:id`: Fetch a single users by its `id`
- `/posts`: Fetch all posts
- `/posts/:id`: Fetch a single post by its `id`### `POST`
- `/users`: Create a new user
- `/posts`: Create a new post### `PUT`
- `/users/:id`: Update a user by its `id`
- `/posts/:id`: Update a post by its `id`### `DELETE`
- `/users/:id`: Delete a user by its `id`
- `/posts/:id`: Delete a post by its `id`