Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
adbad884
Commit
adbad884
authored
Mar 16, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
read user.config.js and merge it with global configuration - exports merged configuration
parent
272533fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
debomatic-webui/lib/config.js
debomatic-webui/lib/config.js
+32
-1
No files found.
debomatic-webui/lib/config.js
View file @
adbad884
...
@@ -87,4 +87,35 @@ config.web.status = config.status
...
@@ -87,4 +87,35 @@ config.web.status = config.status
config
.
web
.
host
=
config
.
host
config
.
web
.
host
=
config
.
host
config
.
web
.
hostname
=
config
.
host
+
((
config
.
port
==
80
)
?
''
:
'
:
'
+
config
.
port
)
config
.
web
.
hostname
=
config
.
host
+
((
config
.
port
==
80
)
?
''
:
'
:
'
+
config
.
port
)
module
.
exports
=
config
// read user configuration and merge it
/*
* update object1 with object2 values
*/
function
_merge
(
object1
,
object2
)
{
var
result
=
{}
for
(
p
in
object1
)
{
if
(
object2
.
hasOwnProperty
(
p
))
{
if
(
typeof
object1
[
p
]
===
'
object
'
&&
typeof
object2
[
p
]
===
'
object
'
)
{
result
[
p
]
=
_merge
(
object1
[
p
],
object2
[
p
])
}
else
{
result
[
p
]
=
object2
[
p
]
}
}
else
{
result
[
p
]
=
object1
[
p
]
}
}
return
result
}
try
{
user_config
=
require
(
'
../user.config.js
'
)
console
.
log
(
"
Reading user configutation ...
"
)
module
.
exports
=
_merge
(
config
,
user_config
)
}
catch
(
err
)
{
consol
.
log
(
"
error reading user configutation
"
,
err
)
module
.
exports
=
config
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment