Skip to content
Web application (micro Wiki) written with with Go which implements a native web server.
HTML Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
docs
pages
templates
vendor
.gitignore
Procfile
README.md
main.go

README.md

Go-vanillawiki

Simple implementation of a Go webserver using only native Go components, no external frameworks or libraries, no frills or whatsoever.

The server serves a minimalist wiki editable by anyone.

Run the webserver as such:

go run main.go

You'll see the output in your terminal:

$ go run main.go

Server started... listening on post 5000
URL: http://localhost:5000/

Demo

Heroku: https://go-vanillawiki.herokuapp.com/

Private web server: http://vanillawiki.fieel.space/

Dependencies

Of course you'll need the Go cli to run the project.

This wiki.go file uses the following imports, which are necessary to run this web server:

import (
	"fmt"
	"html/template"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"regexp"
	"strings"
)

These packages should be found in your local ~/go/bin folder (or wherever your GOPATH points to).

Pages

This simple implementation uses some html templates and .txt data sources to create and show individual pages.

Pages are stored in the /pages subdirectory.

This project links to the bulma.io css library for quick styling.

Page templates

Templates are stored in the /templates subdirectory.

Two layouts are used, view.html and edit.html and are respectively used by Go whenever accessing the /view/ or /edit/ subfolder from the browser.

A third custom is used by the homepage.

Page contents

The pages temselves are stored as .txt files.

The page name will become the HTML page title and the body of the file will populate the HTML body.

You can’t perform that action at this time.