Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

29 make the api mock server #30

Merged
merged 4 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM stoplight/prism:5

# get the latest OAS file from nishiki-document repo
RUN wget https://raw.githubusercontent.com/genesis-tech-tribe/nishiki-documents/c1ea7d5a2fd12e1271551fc672b7141f5777ffdf/web-api/nishiki-web-api.yaml \
&& mv nishiki-web-api.yaml /tmp/api.yml
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ You can start editing the page by modifying `app/page.tsx`. The page auto-update

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Run Mock Server

Run the WebAPI mock server:

```bash
npm run mock
```

## Learn More

To learn more about Next.js, take a look at the following resources:
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3'
services:
prism:
build:
context: .
dockerfile: Dockerfile
command: 'mock -h 0.0.0.0 /tmp/api.yml'
ports:
# Serve the mocked API locally as available on port 8080
- '8080:4010'
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"lint:fix": "eslint --ext .ts,.js,.tsx . --fix && prettier --write \"./**/*.{ts,js,tsx,scss}\"",
"format": "prettier --write './**/*.{js,ts,tsx,scss}'",
"prepare": "husky install",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"mock": "docker compose up --build"
},
"dependencies": {
"next": "13.5.4",
Expand Down