Creating a new Rails app is super easy by itself. And, creating a Rails app set up as an API is not much different.
Because we are planning on deploying our app to Heroku we need to set it up with PostgreSQL as the database.The default database in Rails is SQLite, but it is not supported by Heroku
Let’s start!
Run the following line in your terminal to update Rails
gem update rails
and then this line to get the current version of Rails
rails -v
rails new <<APP_NAME>> --api --database=postgresql
_Replace the _
<<APP_NAME>>
_ with the actual name of your app_
#ruby-on-rails #api #postgresql #heroku #coding #software-development #backend #ruby