Skip to content

Latest commit

 

History

History
377 lines (357 loc) · 9.57 KB

config.md

File metadata and controls

377 lines (357 loc) · 9.57 KB

Before we can start the application, we need to set all the configuration values. If you navigate to /javascript you will find config.js. Open this file, and you will see all the settings that are available in one place.

We can break the config file in two parts, default settings and module settings. There is no need too change the "default" settings at all, you can skip too the module settings at the end.

First lets look at the default settings that you may change.

Server settings
Option Description
port

Used to set the port on the server. Be carefull not to use a port that is already in use

Default: 8080

address

Used to set the URL on the server.

Default: 'localhost'

ipWhitelist

Sets what IPs are allowed or blackliested

Default: ['127.0.0.1', '::ffff:127.0.0.1', '::1']

Electron settings

Also, see Electron documentation for more information and settings.

Option Description
options

Define additional settings for Electron app before it's created

Default: {}

fullscreen

Toggles fullscreen on the Electron app

Default: true

autoHideMenuBar

Toggles if the Menu Bar should be visible

Default: false

zoom

Set the zoom on the Electron window

Default: zoom

Defaults
Option Description
language

Sets the language used troughout the application where it's implemented

Default: 'en'

timeFormat

Set the correct Timeformat

Default: 24

units

Sets how to display units

Default: 'metric'

debug

Enables devTools so you can debug

Default: false

Modules

And now let's configurate the modules that are used:

Weather

Option Description
location

Set the location/city

locationID

Set the correct locationId based on your location. Find your correct id by checking OpenWeatherMap

appid

Required

Used to make API calls to collect the weather information. You need to create an account at OpenWeatherMap to get the API key

updateInterval

How often should we get new weather information.

Default: 10 * 60000

apiVersion

The API version to use

Default: 2.5

apiBase

The base URL for OpenWeatherMap API.

weatherEndpoint

The endpoint for the API

Jokes

Option Description
apiEnpoints

Define different API url/endpoints that return a joke

duration

How often to fetch a new joke.

Clock

Option Description
showDate

Allow displaying the date

showSeconds

Allow displaying seconds of the clock

Traffic

Option Description
googleApiKey

Required

Key to enable API calls to Google Maps. I suggest restricting the key for your home IP

zoom

How far should the map zoom in/out based on your latitude and langditude.

updateInterval

How often should we fetch new data from Google Traffick.
NB! The Google Maps API allows X request pr. day (free), so be carefull when changing this value as it may exceed it.
The dafault value is set to 15 * 60000

Latitude & Langitude

Set the latitude and langitude based on where you want the map to show traffic.

Traffic - work

To show the correct traffic flow when you are about to leave for work (or any other place for that matter), you will need to define these settings.

Option Description
showTrafficAt

Allows you to define muliple times for when to show the traffic flow to work

timeFormat

Define what time-format you are passing to showTrafficAt

Default: 'hh:mm:ss'

Latitude & Langitude

Set the latitude and langitude based on where your work is.

center

Set the center point between your home and work address (lat and lng)

Calendar

Show future events from calendar

Option Description
calendarType

Define which calendar service to use. Currently only supports gmail

updateInterval

How often should we fetch new data from the calendar.

Depending on what service you chose to fetch the events from, you then need to set the API parameters

Option Description
url

Full url to API endpoint

queryParams

Additional parameters to send with the API request.

Example for gmail: orderBy: 'starttime'

Bluetooth

Currently only supports adding the Device ID for the given device you want to connect to. Still in development