https://github.com/devkcud/mock-api-hono
mock api meant for testing
https://github.com/devkcud/mock-api-hono
Last synced: 21 days ago
JSON representation
mock api meant for testing
- Host: GitHub
- URL: https://github.com/devkcud/mock-api-hono
- Owner: devkcud
- Created: 2024-05-30T20:18:30.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-05-30T23:29:49.000Z (12 months ago)
- Last Synced: 2025-04-28T20:03:58.597Z (21 days ago)
- Language: TypeScript
- Homepage:
- Size: 27.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
bun:
```bash
bun install
bunx prisma db push
bun run dev
```npm:
```bash
npm install
npx prisma db push
npm run dev
```open `http://localhost:4321`
## Routes
### `GET /posts`
- Respose: `200`
```json
{
"id": 0,
"title": "",
"message": "",
"category": ""
}[]
```### `GET /posts/:id`
- Param `id` -> **Number**
- Response: `200`
```json
{
"id": 0,
"title": "",
"message": "",
"category": ""
}
```- On Error: `400`
```json
{
"message": ""
}
```### `POST /posts`
- Body:
```json
{
"title": "",
"message": "",
"category": "",
}
```- Response: `201` (no body)
- On Error: `400`, `500`
```json
{
"message": ""
}
```### `DELETE /posts/:id`
Param `id` -> **Number**
- Response: `201` (no body)
- On Error: `400`, `500`
```json
{
"message": ""
}
```### `PUT /posts/:id`
Param `id` -> **Number**
- Response: `200` (no body)
- On Error: `400`, `500`
```json
{
"message": ""
}
```