How to Turn an Android Device into a Web Server

Gerasimos Maropoulos
HackerNoon.com
Published in
2 min readJul 14, 2017

--

https://www.youtube.com/watch?v=Vs5CScPeMA0

Hello folks,

Yesterday I did manage to serve my web simple application from my android phone. By following some simple steps you can do it too, it’s ridiculous easy!

First of all I have to say that this experimental is tested and worked only with the Iris web framework, written in Golang and Android version 5.1.

Steps

Open your android device and follow the steps below.

  1. Install & open termux
  2. Execute the following commands by order
$ pkg install git
$ pkg install golang
$ export GOPATH=/data/data/com.termux/files/home/go
$ go get -u -v github.com/kataras/iris
$ cd /data/data/com.termux/files/home/go/src/github.com/kataras/iris/_examples/hello-world
$ go run main.go

3. Open your favorite browser and navigate to
http://localhost:8080

For those who understand better by watching media, I produced a simple video tutorial too!

That’s all, pretty simple. Right?

Share your thoughts about this post and let me know what awesome apps you’re planing to build with Go + Iris!

The full source code of the web app we ran is located there.
If you have any further questions please feel free to leave a comment below or open a discussion with me.

Edit: I want to thanks the dev.to authors for sharing my article, it’s going to be a long night!

--

--

Gerasimos Maropoulos
HackerNoon.com

Senior Software Engineer at PNOĒ. Self-taught developer with 12+ years of experience who loves programming languages. Author of the Iris Web Framework & Neffos.