When building HTTP API with Rails 3.2, should I disable front end things such as .js files?
-
27-10-2019 - |
Pergunta
When building HTTP API which respond only JSON format with Rails 3.2, should I turn off things like Asset Pipeline and javascript files?
If so, how to do it correctly instead of manually deleting which sounds dirty?
Solução
Probably a good idea if you're only serving up the api, here's how:
rails new appname --skip-sprockets
For an existing application, in your application.rb:
config.assets.enabled = false
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow