The project's repo: https://github.com/railstack/go-on-rails
go-on-rails is a Rails generator aims to:
- Integrate some APIs written in Golang to existed Rails app for high performance
- Use your farmiliar Rails tools to develope and manage a Golang app project
- Convert a not very complicated Rails app to Golang equivalent
- Rails 4.2+
- Golang 1.7+
Add this line to your application's Gemfile:
gem 'go-on-rails', '~> 0.3.0'
And then execute:
Or install it yourself as:
$ gem install go-on-rails
You must have a Rails app or to create one before you can try go-on-rails generator to convert a Rails app to Golang codes.
After that you can just run the command to convert the application:
rails g gor [dev(elopment) | pro(duction) | test] [-m model_a model_b model_c ...]
Then a directory named "go_app" with Golang codes will be generated under your Rails app root path.
Install the dependent Golang packages:
Then change to the
go_app directory and run:
go run main.go
You can visit the page in http://localhost:4000 by default.
More command details about go-on-rails generator:
rails g gor --help
More details to visit the project's repo: https://github.com/railstack/go-on-rails
Issues and PRs are very Welcome !!