ImranNaqvi ImranNaqvi - 6 months ago 15
AngularJS Question

Angularjs not working with rails_api in production

I have

Rails API
and i put my
angularjs
index.html
file (alongwith all directory structure) into
public
folder of my
api
. It works great in
development enviroment
but when i try to start it
production
it gives
404
in browser . I don't why ! .
will i have to
precompile
the code ? but i don't think so because


  • my files are in
    public folder
    not the
    app/assets/javascript

  • more is that i have my own folders names in which i placed the

    libraries of
    angular
    ,
    css
    and etc .

    Note: I'm using
    rails api
    where no
    javascript
    folder exists in
    app/assets



Any help will be appreciating

Answer

Just add config.serve_static_files = true in production.rb and will work fine :)