import React, {Component} from 'react'; import './Services.scss'; import {Button, ButtonGroup, Col, Container, Form, FormControl, InputGroup, Modal, Row, Table} from "react-bootstrap"; import axios from "axios"; class Rules extends Component { constructor(props) { super(props); this.state = { rules: [] }; } componentDidMount() { this.loadRules(); } loadRules() { axios.get("/api/rules").then(res => this.setState({rules: res.data})); } render() { let rulesRows = this.state.rules.map(rule => {rule.name} ); return ( ~/rules {rulesRows}
name
port: name: color: notes:
); } } export default Rules;