Skip to content

Quick Start

By reading this section, you will learn how to deploy a GoFM service.

Getting GoFM

We recommend downloading the precompiled GoFM from GitHub Releases, which is the most convenient way to get GoFM. If you are familiar with Golang, or if there is no version available for your computer architecture in GitHub Releases, you can also compile GoFM from the source code.

Project link: https://github.com/ssnat/GoFM

Configuring the Directory

Create a folder named fm and place the GoFM executable in it. Next, create a music folder inside the fm folder and copy your favorite music into it. The final directory structure should look like this:

fm
├─ GoFM // or GoFM.exe
└─ music
   ├─ Style.mp3
   └─ Yesterday.mp3

Starting the Service

Starting the GoFM service is very simple. Open a console and navigate to the fm directory, then execute the following command:

shell
./GoFM -d ./music 
# windows system
./GoFM.exe -d ./music

If you see http server started on [::]:8090 in the console, and you can see the following content by accessing http://127.0.0.1:8090 through a browser:

running

Congratulations 🎉, your first GoFM service has been successfully started. Isn't it simple?

Now let's review the startup command ./GoFM -d ./music. In this command, we used the -d parameter to specify the folder where the audio files are located. In addition to the -d parameter, GoFM also supports other parameters for adjusting service properties, such as the -n parameter for adjusting the service name and the -p parameter for adjusting the service port.

If you want to change the service name to Taylor's Music and run the service on port 8080, you can start the service like this:

shell
./GoFM -d ./music -n "Taylor's Music" -p 8080
# windows system
./GoFM.exe -d ./music -n "Taylor's Music" -p 8080

By accessing http://127.0.0.1:8080 through a browser, you will see that the service name has been changed:

running

If you want to learn more about GoFM parameters, please read the content in the Reference section or open a console and navigate to the directory where GoFM is located, then execute the following command:

shell
./GoFM -h
# windows system
./GoFM.exe -h

The console will output all the parameters supported by GoFM and their descriptions.

Conclusion

By now, you have fully mastered the deployment of a GoFM service. Enjoy using GoFM!

Creative Works Compilation