Skip to content

ogero/BeegoAngularGulp

Repository files navigation

Beego + Angular + Gulp

This is a demo that shows how to use Beego with Angular.

Requirements

  • GoLang (Only tested on go version go1.7.3)
  • Glide as a dependency manager. Binary must reside in PATH env var.
  • Bee Tool for BeeGo development. Binary must reside in PATH env var.
  • NodeJS & NPM Needed for Gulp and JS dependencies (angular, jquery, materializecss, etc)
  • Gulp npm install -g gulp for assets packing. Global install is a must for gulp.

Run Locally

  1. This application uses Glide as a dependency manager for Go
    glide install will vendor all required go packages for you
  2. BeeGo development is aided by Bee Tool bee run -runmode=dev -downdoc=true -gendoc=true
  3. Navigate App: http://localhost:9090/
    Navigate Swagger: http://localhost:9090/swagger

Watchers & Automatic respawn

Bee Tool attachs a file watcher that matches all go files in project, so a rebuild (app / apidoc) and launch will be performed on code changes. Also, on main.go, another filewatcher is setup to match all JS, CSS and SASS files, which fires gulp for assets packing when changed.
Notes: Bee watcher package (bee tool v1.6.2) had a bug that could fail to trigger the rebuild process on file changes, if needed, check patched binaries.

Pack for deployment

Packing with Bee tool bee pack -exp=.:node_modules -f=zip
Packing excluding node_modules (will be fetch on run) bee pack -f=zip