Skip to content

Commit

Permalink
Adds a 'public' static files endpoint, with a favicon implementation. C…
Browse files Browse the repository at this point in the history
…loses mui#14
  • Loading branch information
ctrlplusb committed Aug 8, 2016
1 parent 070cd90 commit dd72aba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Binary file added public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions src/server/htmlPage/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function render(rootReactElement, initialState) {
<meta charSet='utf-8' />
<meta httpEquiv='X-UA-Compatible' content='IE=edge' />
<meta httpEquiv='Content-Language' content='en' />
<link rel='shortcut icon' type='image/x-icon' href='/public/favicon.ico' />
${helmet && helmet.title.toString()}
${helmet && helmet.meta.toString()}
Expand Down
7 changes: 7 additions & 0 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import express from 'express';
import compression from 'compression';
import hpp from 'hpp';
import helmet from 'helmet';
import path from 'path';
import universalReactAppMiddleware from './middleware/universalReactApp';
import clientConfigBuilder from '../../webpack.client.config.js';

Expand Down Expand Up @@ -46,6 +47,12 @@ app.use(
express.static(webpackClientConfig.output.path)
);

// Configure static serving of our "public" static files.
app.use(
'/public/',
express.static(path.resolve(__dirname, '../../public'))
);

// Bind our universal react app middleware as the handler for all get requests.
app.get('*', universalReactAppMiddleware);

Expand Down

0 comments on commit dd72aba

Please sign in to comment.