Troubleshooting
The most common malfunctions that may come up when using the Gowebly CLI.
🤔 Can't find the answer here?
Feel free to create an issue or start a discussion in the Gowebly project repository. And, of course, we would be happy if you could send a PR with suggestions for improving the docs.
Port X is taken by OS
Some operating systems may take up ports that you want to use to develop and deploy your application. You can check if a port is taken by OS by running the command:
bash
lsof -iTCP -sTCP:LISTEN -P
bash
lsof -iTCP -sTCP:LISTEN -P
bash
netstat -aon
There are two ways to change it.
- Set the port number in the
BACKEND_PORT
environment variable before running:
bash
BACKEND_PORT=9000 gowebly run
yaml
# docker-compose.yml
services:
gowebly_default:
# ...
ports:
- '9000:9000'
environment:
BACKEND_PORT: 9000 # same as the exposed container port
# ...
# ...
- Edit the port number in the
server.go
file:
go
// runServer runs a new HTTP server with the loaded environment variables.
func runServer() error {
// Validate environment variables.
port, err := strconv.Atoi(gowebly.Getenv("BACKEND_PORT", "9000"))
if err != nil {
return err
}
// ...
Now, you can open your browser and go to the http://localhost:9000
.