Skip to content

Commit

Permalink
docs: auto rest endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Sep 17, 2024
1 parent 13b3e14 commit 7b9c2af
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Moquerie is a tool that allows you to easily create a fake GraphQL or REST API (
- **Snapshots** (full or partial) (can be saved and committed to your repository)
- History
- Generate database tables (aka 'Resource Types') from GraphQL schema or TypeScript files
- Automatic **RESTful endpoints** (GET, POST, PUT, PATCH, DELETE)
- Automatic **GraphQL server**
- **No-Code read queries** (for GraphQL)
- **Dashboard UI**
Expand Down Expand Up @@ -114,6 +115,15 @@ export default defineConfig({
})
```

With this configuration, moquerie will automatically create RESTful endpoints for each resource types found with:

- `GET /resourceType`: list all instances
- `POST /resourceType`: create a new instance
- `GET /resourceType/:id`: get an instance
- `PUT /resourceType/:id`: update an instance
- `PATCH /resourceType/:id`: update an instance
- `DELETE /resourceType/:id`: delete an instance

Here is an example that demonstrate several supported features such as importing types from other files, optional fields, union types, and deprecated fields:

```ts
Expand Down

0 comments on commit 7b9c2af

Please sign in to comment.