go-on-rails: A Rails generator to develop or generate a Go application
2754 단어 5루비RailsActiveRecord
go-on-rails is a Rails generator aims to:
Here's a simple example(tutorial) shows the basic usage of go-on-rails generator, and another example shows how to integrate Go APIs in a Rails project.
Prerequisites
Installation
Add this line to your application's Gemfile:
gem 'go-on-rails', '~> 0.3.0'
And then execute:
$ bundle
Or install it yourself as:
$ gem install go-on-rails
Usage
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:
rails gor:deps
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: htps : // 기주 b. 코 m / 라이 LS CK / GO ON RA LS
Issues and PRs are very Welcome !!
Reference
이 문제에 관하여(go-on-rails: A Rails generator to develop or generate a Go application), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/B1nj0y/items/e8e8922d33c9408280f1텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)