This project is a basic implementation of ReDoc component, that is OpenAPI/Swagger-generated API Reference Documentation
For more details, visit: https://github.com/Redocly/redoc
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Based in VSCode React Tutorial and ReDoc Documentation
In a terminal or command prompt type:
- Install Create React App
npm install -g create-react-app
- Create your application
create-react-app redoc-app
- Navigate to application folder
cd redoc-app
- Open Visual Studio Code
code .
- Installing ReDoc component
yarn add redoc
OR
npm install redoc --save
- Install ReDoc dependencies
npm i react react-dom mobx@^4.2.0 styled-components core-js
- Edit app.js file:
import React from 'react';
import logo from './logo.svg';
import './App.css';
import { RedocStandalone } from 'redoc';
function App() {
return (
<div className="App">
<RedocStandalone
specUrl="http://rebilly.github.io/RebillyAPI/openapi.json"
onLoaded={error => {
if (!error) {
console.log('Yay!');
}
}}
/>
</div>
);
}
export default App;
- Run the project:
yarn start
or
npm start
if you get the error 'mobx' does not contain an export named '$mobx' update all dependencies running the command: npm update