Is there any way to check if any instance of Echo server is already running so that only one instance of Echo server run at one time.
I have this code
func main() {
// Echo instance
e := echo.New()
// Start server
e.Logger.Fatal(e.Start(":1323"))
}
and what I am thinking is:
func main() {
// Echo instance
if(<<SOME LOGIC TO GET IF ECHO INSTANCE IS RUNNING, OR HOW MANY INSTANCES ARE RUNNING TO ASSIGN NEW INSTANCE ONLY IF INSTANCE PREVIOUS IS 0>>){
e := echo.New()
}
// Start server
e.Logger.Fatal(e.Start(":1323"))
}
I am supposed to replace "<<SOME LOGIC TO GET IF ECHO INSTANCE IS RUNNING, OR HOW MANY INSTANCES ARE RUNNING TO ASSIGN NEW INSTANCE ONLY IF INSTANCE PREVIOUS IS 0>>", Any pointer?