- Get the latest code.
go get -u -v github.com/mikasoftware/mikapost-go
- Open up
postgre
s and run the following to setup the database for development or production.
drop database mikapost_db;
create database mikapost_db;
\c mikapost_db;
CREATE USER golang WITH PASSWORD 'YOUR_PASSWORD';
GRANT ALL PRIVILEGES ON DATABASE mikapost_db to golang;
ALTER USER golang CREATEDB;
ALTER ROLE golang SUPERUSER;
CREATE EXTENSION postgis;
- Run the following to setup the database for unit testing.
drop database mikapost_test_db;
create database mikapost_test_db;
\c mikapost_test_db;
CREATE USER golang WITH PASSWORD 'YOUR_PASSWORD';
GRANT ALL PRIVILEGES ON DATABASE mikapost_test_db to golang;
ALTER USER golang CREATEDB;
ALTER ROLE golang SUPERUSER;
CREATE EXTENSION postgis;
- Install the project dependencies.
./requirements.sh
- Update environmental variables by running the following. Please change the variables to whatever you prefer.
#!/bin/bash
export MIKAPOST_GORM_CONFIG="postgres://golang:YOUR_PASSWORD@localhost/mikapost_db?sslmode=disable"
export MIKAPOST_SECRET="YOUR_SECRET_RANDOM_STRING"
export MIKAPOST_ADDRESS="127.0.0.1:8080"
export TEST_MIKAPOST_GORM_CONFIG="postgres://golang:YOUR_PASSWORD@localhost/mikapost_test_db?sslmode=disable"
Run the following command in your terminal for development purposes:
$ cd ~/go/src/github/mikasoftware/mikapost-go
$ go run main.go
Or run the following command in your terminal for production purposes:
$ go install github/mikasoftware/mikapost-go