When building HTTP API with Rails 3.2, should I disable front end things such as .js files?

StackOverflow https://stackoverflow.com/questions/9339266

  •  27-10-2019
  •  | 
  •  

문제

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?

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top