If you want to run everything from one server, just use Rails, not Rails-api. Rails includes everything you need for the API anyway (e.g. format.json, render: json, etc.), but also includes traffic for assets that you can use to serve your SPA.
Create a new Rails project, create a page controller that will serve the index.html.erb page of your SPA, and off. You will not need to touch any other Rails view folders. You can create your own folder + JS folder structure for your SPA, as part of the main Rails project.
You can do this with the Rails-api, but you can import parts of the core Rails libraries to have everything on one server.
source share