Skip to content

Commit

Permalink
Serve a favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
GordyD committed Dec 7, 2015
1 parent a0cafca commit 8ed0d81
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Binary file added images/favicon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/favicon.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ app.post('/api/0/events', api.addEvent);
app.post('/api/0/events/:id', api.editEvent);
app.delete('/api/0/events/:id', api.deleteEvent);

app.get('/favicon.ico', (req, res) => res.sendFile(path.join(__dirname, 'images', 'favicon.ico')));

/**
* Universal Application endpoint
*/
Expand Down
6 changes: 4 additions & 2 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function handleRender(req, res) {
)(createStore)(reducers, initialState);

// Wire up routing based upon routes
store.dispatch(match(req.url, (error, redirectLocation) => {
store.dispatch(match(req.url, (error, redirectLocation, renderProps) => {
if (error) {
console.log('Error', error);
res.status(400);
Expand All @@ -46,11 +46,13 @@ export function handleRender(req, res) {
return;
}



// Render the component to a string
const html = ReactDOMServer.renderToString(
<div>
<Provider store={store}>
<ReduxRouter />
<ReduxRouter {...renderProps} />
</Provider>
</div>
);
Expand Down

0 comments on commit 8ed0d81

Please sign in to comment.