Modern Swagger JSON Management Tool
First, you need to get a json file supported by swagger.
Then put the downloaded file in the src/data/ directory.
// package.json
"script": {
...
"download:pet": "curl https://petstore.swagger.io/v2/swagger.json > src/data/pet.json",
"download": "npm run download:pet"
...
}
And add the downloaded json file to the src/data/index.ts file.
// src/data/index.ts
import pet from './pet.json';
export default {
pet, // add json file
} as {[key: string]: any}
git clone https://github.com/easylogic/whatsup
cd whatsup
yarn
yarn start
To prevent CORS problems, please Add HOST
and PORT
to the start script.
"scripts": {
"start": "HOST=local.your-test-domain.com PORT=5300 react-scripts start --progress",
}
And you can edit the hosts file.
vi /etc/hosts
127.0.0.1 local.your-test-domain.com
yarn build
After executing yarn build, SPA related files are created in the build directory.
Use this output if you want to deploy to a specific static server.