Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nos Hs2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Språksamlingane
stadnamn
Nos Hs2023
Commits
fc654b6f
Commit
fc654b6f
authored
3 years ago
by
esikkala
Browse files
Options
Downloads
Patches
Plain Diff
Mapbox token as env variable
parent
0ce6ee32
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/client/configs/portalConfig.json
+0
-1
0 additions, 1 deletion
src/client/configs/portalConfig.json
src/client/helpers/helpers.js
+5
-1
5 additions, 1 deletion
src/client/helpers/helpers.js
webpack.client.common.js
+3
-1
3 additions, 1 deletion
webpack.client.common.js
with
8 additions
and
3 deletions
src/client/configs/portalConfig.json
+
0
−
1
View file @
fc654b6f
...
...
@@ -83,7 +83,6 @@
}
},
"mapboxConfig"
:
{
"mapboxAccessToken"
:
"pk.eyJ1IjoiZWtrb25lbiIsImEiOiJja2FkbGxiY2owMDZkMnFxcGVqNTZ0dmk2In0.6keLTN8VveJkM5y4_OFmUw"
,
"mapboxStyle"
:
"light-v10"
},
"yasguiConfig"
:
{
...
...
This diff is collapsed.
Click to expand it.
src/client/helpers/helpers.js
+
5
−
1
View file @
fc654b6f
...
...
@@ -187,9 +187,13 @@ export const createURIfromLocalID = ({ localID, baseURI, URITemplate }) => {
}
export
const
processPortalConfig
=
async
portalConfig
=>
{
const
{
layoutConfig
}
=
portalConfig
const
{
layoutConfig
,
mapboxConfig
}
=
portalConfig
const
{
bannerImage
,
bannerBackround
}
=
layoutConfig
.
mainPage
const
{
default
:
bannerImageURL
}
=
await
import
(
/* webpackMode: "eager" */
`../img/
${
bannerImage
}
`
)
const
mapboxAccessToken
=
process
.
env
.
MAPBOX_ACCESS_TOKEN
if
(
mapboxConfig
&&
mapboxAccessToken
)
{
mapboxConfig
.
mapboxAccessToken
=
mapboxAccessToken
}
layoutConfig
.
mainPage
.
bannerBackround
=
bannerBackround
.
replace
(
'
<BANNER_IMAGE_URL
'
,
bannerImageURL
)
}
...
...
This diff is collapsed.
Click to expand it.
webpack.client.common.js
+
3
−
1
View file @
fc654b6f
const
path
=
require
(
'
path
'
)
const
dotenv
=
require
(
'
dotenv
'
).
config
()
const
HtmlWebpackPlugin
=
require
(
'
html-webpack-plugin
'
)
const
{
CleanWebpackPlugin
}
=
require
(
'
clean-webpack-plugin
'
)
const
webpack
=
require
(
'
webpack
'
)
...
...
@@ -27,7 +28,8 @@ module.exports = {
favicon
:
'
src/client/favicon.ico
'
}),
new
webpack
.
DefinePlugin
({
'
process.env.API_URL
'
:
JSON
.
stringify
(
apiUrl
)
'
process.env.API_URL
'
:
JSON
.
stringify
(
apiUrl
),
'
process.env
'
:
JSON
.
stringify
(
dotenv
.
parsed
)
})
],
output
:
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment