Public folder in Rails-Api

210 views
Skip to first unread message

Richard McSharry

unread,
Sep 30, 2013, 6:38:04 AM9/30/13
to rails-a...@googlegroups.com
Hi,
 
We recently used the Rails-api project and notice that it still generates the Public folder with the following files:
 
404.html
422.html
500.html
favicon.ico
index.html
robots.txt
 
Surely these files are not required for an API only project?
 
Just my 2 cents!
 
Thanks,
Richard

mic...@epicodus.com

unread,
Nov 4, 2013, 1:05:17 AM11/4/13
to rails-a...@googlegroups.com
A lot of people use rails-api for apps that serve up an API, but also a client-side MVC frontend (with Ember/Angular/etc). So it makes to me to have robots.txt and favicon.ico. 

I'm not so sure about 404/422/500.html - I would think you'd want to use a catch-all route for Rails, and then have your client-side app display the appropriate error for page not found/not authorized/server error.

Richard McSharry

unread,
Nov 4, 2013, 7:37:27 AM11/4/13
to rails-a...@googlegroups.com
Thanks Michael, I take your point regarding serving client-side too and hence robots.txt and favicon.ico do make sense. Like you I am still unsure about the usefuleness of the html files. Maybe someone wiser can point out a sensible reason...
Reply all
Reply to author
Forward
0 new messages