The purpose of this example is to provide details as to how one would go about creating a Restful API with the Buffalo Web Framework.
- If you need help, use Stack Overflow. (Tag 'go')
- If you'd like to ask a general question, use Stack Overflow.
- If you found a bug, open an issue.
- If you have a feature request, open an issue.
- If you want to contribute, submit a pull request.
-
clone this repository
$ git clone git@github.com:conradwt/zero-to-restful-api-using-buffalo.git
-
change directory location
$ cp /path/to/zero-to-restful-api-using-buffalo restful_api $ cd /path/to/restful_api
-
create, migrate, and seed the database
$ buffalo db create $ buffalo db migrate $ buffalo task db:seed
-
start the server
$ buffalo dev
-
navigate to the Postman application
a. set the HTTP request type to
GET
b. set the request URL to
http://localhost:3000/players
c. click
Headers
, add the following key and value pair:Key
Content-Type
Value
application/json
d. click
Send
, and you should see something like the following:[ { "id": "39bac424-8734-4705-a06b-8a20c1bfd55c", "created_at": "2018-08-03T00:14:51.941791Z", "updated_at": "2018-08-03T00:14:51.941792Z", "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "age": 25, "position": "forward" }, { "id": "7e46a404-b361-4e3c-b16d-73ebd779c28f", "created_at": "2018-08-03T00:14:51.953796Z", "updated_at": "2018-08-03T00:14:51.953797Z", "first_name": "Jane", "last_name": "Doe", "email": "jane.doe@example.com", "age": 23, "position": "goalkeeper" } ]
WIP
Ready to run in production? Please check our deployment guides.
- Official website: https://gobuffalo.io
- Guides: https://gobuffalo.io/en/docs/goth
- Docs: https://godoc.org/github.com/gobuffalo/buffalo
- Mailing list: WIP
- Source: https://github.com/gobuffalo
Bug reports and feature requests can be filed with the rest for the Zero to Restful API using Buffalo project here:
Zero to Restful API using Buffalo is released under the MIT license.
copyright:: (c) Copyright 2018 Conrad Taylor. All Rights Reserved.