Skip to content

parraclaudio/ReDocSample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redoc-App Sample

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

How to run

In the project directory, you can run:

yarn start

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.

Step-By-Step - How to create the project

Based in VSCode React Tutorial and ReDoc Documentation

In a terminal or command prompt type:

  1. Install Create React App
 npm install -g create-react-app
  1. Create your application
create-react-app redoc-app
  1. Navigate to application folder
cd redoc-app
  1. Open Visual Studio Code
code .
  1. Installing ReDoc component
yarn add redoc

OR

npm install redoc --save
  1. Install ReDoc dependencies
npm i react react-dom mobx@^4.2.0 styled-components core-js
  1. 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;
  1. 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