Skip to content
This repository has been archived by the owner on Nov 15, 2017. It is now read-only.

Commit

Permalink
Added favicon handling
Browse files Browse the repository at this point in the history
  • Loading branch information
swernerx committed Feb 1, 2017
1 parent f374c82 commit c0b7893
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 34 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# Build output folders
build/
public/
dist/
lib/
bin/
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
"redux-thunk": "^2.2.0",
"rimraf": "^2.5.4",
"serialize-javascript": "^1.3.0",
"serve-favicon": "^2.3.2",
"shrink-ray": "^0.1.3",
"source-map-support": "^0.4.11",
"style-loader": "^0.13.1",
Expand Down
Binary file added public/favicon.ico
Binary file not shown.
4 changes: 4 additions & 0 deletions src/server/createExpressServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import uuid from "uuid"
import parameterProtection from "hpp"
import helmet from "helmet"
import PrettyError from "pretty-error"
import favicon from "serve-favicon"

import {
ABSOLUTE_CLIENT_OUTPUT_PATH,
Expand All @@ -23,6 +24,9 @@ export default function createExpressServer()
// Create our express based server.
const server = express()

// Create new middleware to serve a favicon from the given path to a favicon file.
server.use(favicon(`${ABSOLUTE_PUBLIC_PATH}/favicon.ico`))

// Attach a unique "nonce" to every response. This allows use to declare
// inline scripts as being safe for execution against our content security policy.
// @see https://helmetjs.github.io/docs/csp/
Expand Down
53 changes: 20 additions & 33 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ camelcase@^1.0.2, camelcase@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39"

camelcase@^2.0.0, camelcase@^2.0.1:
camelcase@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"

Expand Down Expand Up @@ -1786,7 +1786,7 @@ cliui@^2.1.0:
right-align "^0.1.1"
wordwrap "0.0.2"

cliui@^3.0.3, cliui@^3.2.0:
cliui@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d"
dependencies:
Expand Down Expand Up @@ -7850,6 +7850,15 @@ serialize-javascript@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.3.0.tgz#86a4f3752f5c7e47295449b0bbb63d64ba533f05"

serve-favicon@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/serve-favicon/-/serve-favicon-2.3.2.tgz#dd419e268de012ab72b319d337f2105013f9381f"
dependencies:
etag "~1.7.0"
fresh "0.3.0"
ms "0.7.2"
parseurl "~1.3.1"

serve-static@~1.11.2:
version "1.11.2"
resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.11.2.tgz#2cf9889bd4435a320cc36895c9aa57bd662e6ac7"
Expand Down Expand Up @@ -7987,7 +7996,7 @@ source-map-support@^0.4.0, source-map-support@^0.4.11, source-map-support@^0.4.2
dependencies:
source-map "^0.5.3"

source-map@0.1.31:
source-map@0.1.31, source-map@~0.1.7:
version "0.1.31"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.31.tgz#9f704d0d69d9e138a81badf6ebb4fde33d151c61"
dependencies:
Expand All @@ -8003,12 +8012,6 @@ source-map@^0.4.2, source-map@^0.4.4, source-map@~0.4.1:
dependencies:
amdefine ">=0.0.4"

source-map@~0.1.7:
version "0.1.43"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346"
dependencies:
amdefine ">=0.0.4"

source-map@~0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d"
Expand Down Expand Up @@ -8890,10 +8893,6 @@ window-size@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d"

window-size@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876"

window-size@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075"
Expand Down Expand Up @@ -8954,7 +8953,7 @@ xmldom@^0.1.19:
version "4.0.1"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"

y18n@^3.2.0, y18n@^3.2.1:
y18n@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"

Expand Down Expand Up @@ -9000,17 +8999,14 @@ yargs@^1.2.6:
version "1.3.3"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-1.3.3.tgz#054de8b61f22eefdb7207059eaef9d6b83fb931a"

yargs@^3.5.4:
version "3.32.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995"
yargs@^3.5.4, yargs@~3.10.0:
version "3.10.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"
dependencies:
camelcase "^2.0.1"
cliui "^3.0.3"
decamelize "^1.1.1"
os-locale "^1.4.0"
string-width "^1.0.1"
window-size "^0.1.4"
y18n "^3.2.0"
camelcase "^1.0.2"
cliui "^2.1.0"
decamelize "^1.0.0"
window-size "0.1.0"

yargs@^5.0.0:
version "5.0.0"
Expand Down Expand Up @@ -9048,12 +9044,3 @@ yargs@^6.0.0, yargs@^6.3.0:
which-module "^1.0.0"
y18n "^3.2.1"
yargs-parser "^4.2.0"

yargs@~3.10.0:
version "3.10.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"
dependencies:
camelcase "^1.0.2"
cliui "^2.1.0"
decamelize "^1.0.0"
window-size "0.1.0"

0 comments on commit c0b7893

Please sign in to comment.