Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 631 Bytes

readme.md

File metadata and controls

28 lines (21 loc) · 631 Bytes

Golang Web Server and Parsing Static File

This project demonstrate a basic golang server creation. Parsing and Routing between mutiple static pages using Golang's core package(net/http).

Main commands

creating server :

http.ListenAndServe(":PORT",nil)

Handling routes

http.HandleFunc("/path",routeHandlerFunctionName)

Parsing Static Html pages

template.ParseFiles("/dir/path/file.html")
template.ParseGlob("/dir/path/*.html)

Render HTML pages and pass data to them

Execute(responseWriter, nil)
ExecuteTemplate(responseWriter,"index.html","pass vale to static page")