How to run the Go web app at Windows server

I’ve my go app the is running a web API and working smoothly at my laptop.

enter image description here

I read this and completed the IIS setup using a config file:

<configuration>
    <system.webServer>
        <rewrite>
            <rules>					
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://localhost:9000/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

And copied the compiled file at the same location, but once I gone for the url I got nothing, and once I run the .exe file I got it terminated quickly!

Any idea how to be able to run this execuatble file at MS server.

enter image description here

UPDATE

If I removed the binding at the server, then the app is working fine, it looks this binding process is blocking the port!

Hello Everyone,
To run a Go web application on a Windows Server, you can follow these steps:

  1. Install Go: Download and install the latest version of Go for Windows from the official website.
  2. Set the GOPATH environment variable: Set the GOPATH environment variable to the path where you want to store your Go projects.
  3. Install Git: Download and install Git for Windows if you plan to use Git to manage your Go project’s source code.
  4. Clone or download the Go project: Clone or download the Go project from a source code repository such as GitHub.
  5. Build the Go project: Open the Command Prompt and navigate to the project’s directory. Use the “go build” command to build the Go project.
  6. Run the Go project: Use the “go run” command to run the Go project. By default, the Go web app will listen on port 8080. You can specify a different port using the -port flag.
  7. Configure a web server: To make the Go web app accessible from the internet, you will need to configure a web server such as IIS or Apache to forward requests to the Go app.
  8. Test the app: Open a web browser and navigate to the server’s IP address or hostname to test the Go web app.

These steps should allow you to run a Go web application on a Windows Server. Note that the specifics of these steps may vary depending on the specific version of Windows Server and the Go project you are running. I hope query will be fixed out after applying the following process step-by-step.

1 Like

Thanks a lot.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.