Using Tango on Ubuntu 14.04

  • Last Created On Dec 09, 2024
  • 13
0 0

Tango is a micro and pluggable web framework built with Golang. It has powerful routing and flexible route combinations, dependency injection embedded, and allows direct integration with existing services. This article will show you how to install and use Tango on Ubuntu 14.04.

If you do not have Golang installed, install Golang using the directions in this article. This may also work on other distros but results will vary.

Install Dependencies

You can skip this step if you have already installed the version controls. Golang will require you to install gitbzr, and/or mercurial. This may be needed if you are downloading libraries from a version control system that is using one of those protocols.

apt-get update
apt-get dist-upgrade -y
apt-get install git bzr mercurial -y

Once everything is installed, you can proceed to the next step.

Install Tango

To install Tango, run the following command:

go get github.com/lunny/tango

If everything went well, you can proceed to the next step. If there was an error, verify your GOPATH by running go env and checking its path. If your project is outside of the GOPATH, and you get a warning about it, you can safely ignore it.

Using Tango

To use Tango, create a file called server.go and populate it with the following lines of code:

package main

import (
  "github.com/lunny/tango"
)

func main() {
t := tango.Classic()
    t.Get("/", func() string {
    return "Hello from AKLWEB HOST Server!"
    })
t.Run()
}

Afterwards, run go run server.go.

Switch over to your web browser and type http://[SERVER_IP]:8000/. Replace [SERVER_IP] with the IP address of your VPS.

If your installation was successful, you will see “Hello from AKLWEB HOST Server!” in your browser.

Views: 13

Recent Articles

  • How to Install JAX with ROCm Acceleratio...
    96
  • Deploy a PyTorch Workspace on a Vultr Cl...
    71
  • Managing Backup Storage
    82
  • Automating FTP Backups in Windows Server
    71
  • Automating FTP Backups in Linux
    75

Popular Articles

  • Our General Terms & Conditions
    2630
  • Our Privacy Policy
    2474
  • Our Cookies Policy
    275
  • Our Terms of Use
    152
  • How to Install JAX with ROCm Acceleratio...
    96