Categorygithub.com/thewhitetulip/go-vue-events
modulepackage
0.0.0-20200609105340-e31b4f38b8c8
Repository: https://github.com/thewhitetulip/go-vue-events.git
Documentation: pkg.go.dev

# README

Vue Events Bulletin Board

This is the Go backend code for the Vue.js tutorial on Scotch.io. In the tutorial we build a events bulletin board application and cover the basics of Vue.

Please read the server.go file for elaborate comments.

If you are new to Go, read my book or read the working code of the project which is taught in the book here.

Building the app

  1. install Go
  2. go get github.com/thewhitetulip/go-vue-events
  3. go run server.go
  4. Open localhost:8080 in your browser

Build in Docker

  1. Install Docker 2.``` docker build --tag go-vue-events:1.0 .
3.```
docker run --publish 8000:8080 --detach --name gve go-vue-events:1.0

Remove docker image

docker rm --force gve

# Functions

AddHandler handles the http POST request for /api/events/.
DeleteHandler will handle the DELETE http req for /api/events/.
EventsHandler is the http end point which will supply the list of eventsto our vue front end; handles the GET http request for /api/events/.
HomeHandler will be rendering the index.html template, it is written in Vue.

# Structs

Events is the struct which defines our events **it is very important to have the fields capitalized**.