This repository was archived by the owner on Mar 21, 2025. It is now read-only.
File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -64,13 +64,17 @@ func initializeFromEmpty(ctx context.Context, server *pslive.Server) error {
64
64
if err != nil {
65
65
return errors .Wrap (err , "couldn't add default instrument for local planktoscope" )
66
66
}
67
+ localhost := "localhost"
68
+ if l := os .Getenv ("LOCALHOST_DEFAULT" ); l != "" {
69
+ localhost = l
70
+ }
67
71
if _ , err = is .AddCamera (ctx , instruments.Camera {
68
72
InstrumentID : iid ,
69
73
Enabled : true ,
70
74
Name : "preview" ,
71
75
Description : "The picamera preview stream" ,
72
76
Protocol : "mjpeg" ,
73
- URL : "http://localhost :8000" ,
77
+ URL : fmt . Sprintf ( "http://%s :8000" , localhost ) ,
74
78
}); err != nil {
75
79
return errors .Wrap (err , "couldn't add default camera for local planktoscope" )
76
80
}
@@ -80,7 +84,7 @@ func initializeFromEmpty(ctx context.Context, server *pslive.Server) error {
80
84
Name : "controller" ,
81
85
Description : "The MQTT control API" ,
82
86
Protocol : "planktoscope-v2.3" ,
83
- URL : "mqtt://localhost :1883" ,
87
+ URL : fmt . Sprintf ( "mqtt://%s :1883" , localhost ) ,
84
88
}
85
89
controllerID , err := is .AddController (ctx , controller )
86
90
if err != nil {
You can’t perform that action at this time.
0 commit comments