Skip to content

Instantly share code, notes, and snippets.

@mayra-cabrera
Last active February 4, 2016 15:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mayra-cabrera/d7d6b2ecc3f8404e8629 to your computer and use it in GitHub Desktop.
Resumen Go Meetup: Construyendo un API en Beego

Por @arnoldocolin

1 - Instalar go con gvm https://github.com/moovweb/gvm

2 - Instalar beego y bee (toolbelt) http://beego.me/quickstart

$ go get github.com/astaxie/beego
$ go get github.com/beego/bee

3 - Puedes usar cualquier base de datos o tomar una de ejemplo

4 - Usa el comando bee api para exponer tu base de datos

Información: https://github.com/beego/bee

bee api [appname] [-tables=""] [-driver="mysql"] [-conn="[user]:[pass]@tcp(127.0.0.1:3306)/[dbname]"]
    -tables: a list of table names separated by ',', default is empty, indicating all tables
    -driver: [mysql | postgres | sqlite], the default is mysql.
    -conn:   the connection string used by the driver, the default is 
             e.g. for mysql:    root:@tcp(127.0.0.1:3306)/test
             e.g. for postgres: postgres://[user]:[pass]@127.0.0.1:5432/[dbname]
bee api my_first_api -driver="mysql" -conn="root:password_de_root@tcp(127.0.0.1:3306)/nombre_base_de_datos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment