import React, { Component } from 'react' class PageviewsList extends React.Component { constructor(props) { super(props); this.state = { records: [] }; this.refresh() && window.setInterval(this.refresh.bind(this), 60000); } refresh() { return fetch('/api/pageviews') .then((r) => r.json()) .then((data) => { this.setState({records: data}); }); } render() { const tableRows = this.state.records.map((p, i) =>
# | URL | Pageviews | Unique |
---|