go-br/crud

Name: crud

Owner: go-br

Description: Simple master detail web form with pREST write in Golang

Created: 2017-11-04 11:28:10.0

Updated: 2018-02-19 20:59:54.0

Pushed: 2018-02-19 20:53:51.0

Homepage:

Size: 17

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

crud

Simple master detail web crud with Golang and pREST

Install

pREST
et github.com/prest/prest
Caddy
et github.com/mholt/caddy/caddy

Start Postgresql server

Create database
tedb gocrud

Run database migrations

attention: To run pREST you need a precreated database

rt PREST_HTTP_PORT=3000
rt PREST_PG_HOST=127.0.0.1
rt PREST_PG_USER=postgres
ort PREST_PG_PASS=
rt PREST_PG_DATABASE=gocrud
rt PREST_PG_PORT=5432
rt PREST_JWT_KEY="your jwt key here"
rt PREST_MIGRATIONS=./postgresql
rt PREST_QUERIES_LOCATION=./queries
t migrate up

Start pREST server

t

Start Gatekeeper

tekeeper
Teste Gatekeeper
 --user gocrud@example.com:1234 localhost:4000

Then get the jwt token and put the value on $JWT_TOKEN environment variable, to test pREST.

Test pREST with authentication
 -i -H 'authorization: Bearer $JWT_TOKEN localhost:3000/databases

You must see your databases now.

Start frontend app

ontendapp

Start Caddy

y -conf ./caddy/Caddyfile

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.