Skip to content

Commit

Permalink
Fix loading of Medium News items
Browse files Browse the repository at this point in the history
  • Loading branch information
austinkettner committed Jun 10, 2018
1 parent ba1dd62 commit 5361b52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions kit/entry/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ const app = new Koa()
const total = end.microseconds + (end.milliseconds * 1e3) + (end.seconds * 1e6);
ctx.set('Response-Time', `${total / 1e3}ms`);
})

.use(async (ctx, next) => {
await next();
ctx.set('Access-Control-Allow-Origin', '*');
})

// Create a new Apollo client and Redux store per request. This will be
// stored on the `ctx` object, making it available for the React handler or
Expand Down
2 changes: 1 addition & 1 deletion src/components/public/news/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class News extends React.Component {
}

componentDidMount() {
Feed.load('https://cors-anywhere.herokuapp.com/https://medium.com/feed/@camerakit', (err, rss) => {
Feed.load('https://cors-anywhere.herokuapp.com/https://medium.com/feed/camerakit', (err, rss) => {
if (err) return console.log(err);
this.setState({ items: rss.items });
});
Expand Down

0 comments on commit 5361b52

Please sign in to comment.