Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iot-gateway-setup
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
Container Registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vesta
iot-gateway-setup
Commits
4ba58747
Commit
4ba58747
authored
7 years ago
by
Donald Chen
Browse files
Options
Downloads
Patches
Plain Diff
handle get sn error gracefully.
parent
f000d074
No related branches found
Branches containing commit
No related tags found
1 merge request
!4
Feature/add demo url
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server.js
+2
-2
2 additions, 2 deletions
server.js
with
2 additions
and
2 deletions
server.js
+
2
−
2
View file @
4ba58747
...
...
@@ -342,14 +342,14 @@ function requestHandler(req, res) {
}
else
{
exec
(
'
/usr/bin/unit_serial_number
'
,
function
(
error
,
stdout
,
stderr
)
{
var
sn
=
stdout
.
trim
();
if
(
!
sn
)
{
if
(
error
||
!
sn
)
{
console
.
log
(
"
error getting serial number!
"
,
error
);
sn
=
"
unknown
"
}
var
res_str
=
getStateBasedIndexPage
();
var
host_url
=
sn
+
"
.local
"
;
var
host_port
=
NODE_RED_PORT
.
toString
().
trim
();
console
.
log
(
"
host_url=%s, port=%s
"
,
host_url
,
host_port
);
res_str
=
res_str
.
replace
(
/params_hostname/g
,
host_url
);
res_str
=
res_str
.
replace
(
/params_node_red_http_port/g
,
host_port
);
...
...
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