Beego Setup and installation on Windows server

Prerequisites and Go Variable Settings

To start the installation process, first you need to download Git for Windows and update below required settings for GO environment variables.

  1. Go the the link https://git-scm.com/download/win and download the latest version Git for Windows.

    Git for Windows

    Once you click on the Download button for the latest Git for Windows version, the installation exe will be saved to your hard disk. Locate the exe that you've just downloaded and run it. Follow the step of installation; once the installation completed you can verify by right click on desktop or any folder. As per below screen-shot.

    Git for Windows
  2. The Go-environment works with a small number of OS environment variables. They are best defined before the installation starts; on Windows you will have to create the empty Go root map first, like C:/Go.
    GOPATH is a folder in which we will install Beego Framework.
    To set GOPATH variables first create new folder in C: drive and update in GOPATH environment variable.

    Note: GOPATH folder should not be folder of GOROOT otherwise you will get the error "$GOPATH must not be set to $GOROOT".
    Go Environment variables
    Here are the most important:
    GOROOT: is the root of the go tree (or installation)
    GOPATH: build and install packages outside the standard Go tree
    GOBIN : the location where the binaries (compiler, linker, etc.) are installed
    Go Environment variables

Start Installation
GO to command prompt and navigate the C:\Goweb folder.
Now run the command "go get github.com/astaxie/beego"
After this Beego framework starts download.
Beego Installation

After download completes you can see 2 new folders in Goweb folder "pkg" and "src". This will shows that Beego framework has been downloaded successfully on our server.

Beego Installation

Now, we need to install bee tool (bee tool is a project that helps developing Beego rapidly. With bee tool we can create, auto compile and reload, develop, test, and deploy Beego applications easily). [It's just like Php artisan for Laravel in Php.]
From command prompt Go to the C:\Go\bin

Run the command "go get github.com/beego/bee"
bee tool Installation After bee tool installation you will see new bee.exe application. bee tool Installation
Create First Beego Project

From command prompt Go to the C:\Goweb

Run the command "bee new demoProject"
beego demoProject

In C:\Goweb\src you will see newly created folder "demoProject"

beego demoProject

From command prompt Go to the C:\Goweb\src\demoProject

Run the command "bee run watchall"
beego demoProject

System will display now alert box just click on "Allow access". Now, go to browser and hit the url "http://localhost:8080/".

Note: Do not close the command prompt window.
beego demoProject