/go-webApp

Go WebApp Tutorial

Primary LanguageGo

go-webApp

Go WebApp Tutorial

Covered in this tutorial:

  • Creating a data structure with load and save methods
  • Using the net/http package to build web applications
  • Using the html/template package to process HTML templates
  • Using the regexp package to validate user input
  • Using closures

1st step

go build wiki-page.go

To run the Wiki App

Wiki 1st (will generate the Sample Page file)

./wiki-page

2nd step

Build the webserver

go build webserver.go

To start the webserver

./webserver

Then http://localhost:8080/Beautiful

Wiki Webserver

go build wiki-web.go

Run

./wiki-web

Then http://localhost:8080/view/TestPage

3rd Step

Build in a different output directory

go build -o bin/wiki-web wiki-web.go

Run

./bin/wiki-web