-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from SpeciesFileGroup/development
Use base_url for logo and add default config
- Loading branch information
Showing
4 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export default { | ||
| base_url: '/', | ||
| hash_mode: false, | ||
| map_tile_server: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', | ||
| map_tile_attribution: | ||
| '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,13 @@ | ||
| import fs from 'fs' | ||
| import yaml from 'js-yaml' | ||
| import glob from 'glob' | ||
| import defaultConfig from '../constants/defaultConfig' | ||
|
|
||
| export const loadConfiguration = appPath => { | ||
| export const loadConfiguration = (appPath) => { | ||
| const filePaths = glob.sync(appPath + '/config/*.yml', {}) | ||
| const jsonConfig = filePaths.map(filepath => yaml.load(fs.readFileSync(filepath, 'utf8'))) | ||
| const jsonConfig = filePaths.map((filepath) => | ||
| yaml.load(fs.readFileSync(filepath, 'utf8')) | ||
| ) | ||
|
|
||
| return Object.assign({}, ...jsonConfig) | ||
| return Object.assign({}, defaultConfig, ...jsonConfig) | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| export function isValidUrl(string) { | ||
| try { | ||
| new URL(string) | ||
| return true | ||
| } catch (err) { | ||
| return false | ||
| } | ||
| } |