GithubHelp home page GithubHelp logo

gopherblog's Introduction

My blog about Go, written in Go. Located at www.gopherblog.org

Requirements

The system assumes that you have successfully installed the following requirements:

  • A running version of MySQL
  • The Go language installed, with correct environment variables (GOPATH, GOROOT, etc)

Setting up the database

To set up the database you need to run the following command:

chmod +x install.sh; ./install.sh

Follow the on-screen instructions and enter your database host and credentials. The second section will ask you to create the Admin credentials and Display Name which you will use to create posts on the blog. The Display Name that you enter here will be displayed on your posts' pages.

Running the blog

First we must compile the main package and all its dependencies into a binary. To do this we run:

go install

This should create the binary called gopherblog in your $GOPATH/bin folder. On my machine, for example, I naively run the blog as:

gopherblog -db="root:root@tcp(localhost:3306)/gopherblog"

The following command-line flags are provided:

Flag Default Value Description
-db= root:root@tcp(localhost:3306)/gopherblog Database connection string.
-host= localhost Hostname that the server runs on
-port= 8080 Port to listen on for HTTP connections
nocache Setting this flag will recompile the HTML templates on every request

Navigating

Route Description
/ Home page of the blog, displays a list of posts
/post/:slug Displays a post with the given slug
/login Displays login page
/manage Manage your posts (requires authentication)
/edit/:id Edit a post with the given ID

gopherblog's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.