2021-02-06 15:07:01 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import './App.css';
|
|
|
|
class App extends Component {
|
2021-02-13 13:14:15 +00:00
|
|
|
state = { streams: [] }
|
2021-02-06 15:07:01 +00:00
|
|
|
componentDidMount() {
|
2021-02-06 19:03:19 +00:00
|
|
|
fetch('/getStreams')
|
2021-02-06 15:07:01 +00:00
|
|
|
.then(res => res.json())
|
2021-02-13 13:14:15 +00:00
|
|
|
.then(streams => this.setState({ streams }));
|
2021-02-06 15:07:01 +00:00
|
|
|
}
|
|
|
|
render() {
|
|
|
|
return (
|
2021-02-13 13:14:15 +00:00
|
|
|
<section class="container">
|
|
|
|
<div class="left-half">
|
|
|
|
<article>
|
|
|
|
<h1>Servers</h1>
|
|
|
|
{this.state.streams.map(stream =>
|
|
|
|
<div key={stream.StreamName}>{stream.StreamName} - {stream.StreamURL}</div>
|
|
|
|
)}
|
|
|
|
</article>
|
|
|
|
</div>
|
|
|
|
<div class="right-half">
|
|
|
|
<article>
|
|
|
|
<h1>Right Half</h1>
|
|
|
|
<p>If your knees aren't green by the end of the day, you ought to seriously re-examine your life.</p>
|
|
|
|
</article>
|
|
|
|
</div>
|
|
|
|
</section>
|
2021-02-06 15:07:01 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export default App;
|