Skip to content

Commit

Permalink
add favicon to application (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniszewski authored Feb 8, 2019
1 parent 8410c63 commit 70b884b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ bin/ci

# Other
**/*.png
assets
**/*.svg
compose
deploy
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ LABEL maintainer="Vapor IO" \
# install Synse Server as a python package
# TODO: this will eventually be done via synse-server itself..
RUN mkdir -p /tmp/synse/procs \
&& mkdir -p /synse/config
&& mkdir -p /synse/config \
&& mkdir -p /etc/synse/static

COPY --from=builder /build /usr/local
COPY ./assets/favicon.ico /etc/synse/static/favicon.ico

ENTRYPOINT ["/usr/bin/tini", "--", "synse-server"]

Expand Down
Binary file added assets/favicon.ico
Binary file not shown.
11 changes: 3 additions & 8 deletions synse_server/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Factory for creating Synse Server Sanic application instances."""

from sanic import Sanic
from sanic.response import text

from synse_server import errors, tasks
from synse_server.api import http, websocket
Expand All @@ -28,13 +27,9 @@ def new_app():
app.blueprint(http.v3)
app.blueprint(websocket.v3)

# Disable favicon
#
# Add a route which provides an empty response for '/favicon.ico' in order
# to prevent missing favicon errors from populating the logs when Synse
# Server is hit via web browser.
# TODO (etd): we could add an icon to return here if we wanted.
app.add_route(lambda *_: text(''), '/favicon.ico')
# Add favicon. This will add a favicon, preventing errors being logged when
# a browser hits an endpoint and can't find the icon.
app.static('/favicon.ico', '/etc/synse/static/favicon.ico')

# Set the language environment variable to that set in the config, if
# it is not already set. This is how we specify the language/locale for
Expand Down

0 comments on commit 70b884b

Please sign in to comment.