buffalo_poc

command
v0.0.0-...-722e3b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2018 License: MIT Imports: 2 Imported by: 0

README

Buffalo POC

Buffalo is a go web framework that will build the majority of your code for you. Unlike goa, it assumes you will be adding more code.

Install buffalo go get -u -v github.com/gobuffalo/buffalo/buffalo go get -u github.com/gobuffalo/buffalo-goth

Some benefits:

  • It will generate the DB tables and all CRUD operations for you.
  • Literally 5 minutes to working api with DB
  • buffalo dev runs the web app locally and you can test input - recompiles on save
  • Supports TONS of auth methods, and can write your own

Please see https://gobuffalo.io/docs for more information

Auth can be tied in with many different providers, for example buffalo g goth-auth digitalocean discord will setup DO and discord auth

Auth video: https://gobuffalo.io/docs/generators#goth

Auth with username and password example (Custom auth example): https://github.com/gobuffalo/authrecipe/blob/master/actions/auth.go

Database Setup

Run docker run -d --name pgsql --net=host -e POSTGRES_PASSWORD=password postgres:alpine get the md5 sum of password echo "password" | md5sum edit the database.yml

To add a new resource besides the ones defined in the design/002-data-server.md type the following: buffalo g resource newResource name id:int email address

This will create a new resource and a new migration in the migrations folder. Once all resources are defined run the below command to create the db.

Run buffalo db create -a

Then run buffalo db migrate to create all of the tables

CreRun the app locally

buffalo dev

Visit 127.0.01:3000 there you can test endpoints

Starting the Application

Buffalo ships with a command that will watch your application and automatically rebuild the Go binary and any assets for you. To do that run the "buffalo dev" command:

$ buffalo dev

If you point your browser to http://127.0.0.1:3000 you should see a "Welcome to Buffalo!" page.

Congratulations! You now have your Buffalo application up and running.

What Next?

We recommend you heading over to http://gobuffalo.io and reviewing all of the great documentation there.

Good luck!

Powered by Buffalo

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL