Skip to content

sei-eternity/rails-api-app-for-axios-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Misk Rails API

Details

Heroku Link

  • This is an API only practice app for an Axios lesson.
  • This has an Event model with name:string and description:string fields.
  • This app allows full CRUD on the Event resource.
  • This app also includes the Faker gem to seed the database.

To run locally

  1. git clone https://github.com/sei-eternity/rails-api-app-for-axios-practice
  2. cd
  3. bundle
  4. rails db:create db:migrate db:seed
  5. rails s

Instructions to build from scratch

  1. rails new api-only --api -d postgresql --skip-test

  2. Gemfile

    gem 'faker'
    gem 'rack-cors'
  3. bundle

  4. rails g scaffold events name description

  5. rails db:create db:migrate db:seed

  6. db/seeds.rb

    10.times do
      newEvent = {
        name: Faker::Coffee.unique.blend_name,
        description: Faker::Hipster.sentence(5)
      }
    
      Event.create(newEvent)
    end
  7. rails s

  8. In config/database.yml, remove username and password from production

  9. git add -A

  10. git commit -m 'first commit'

  11. heroku login

  12. heroku create <NAME-OF-APP>

  13. git push heroku master

  14. heroku run rake db:migrate

  15. heroku run rake db:seed


Additional Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published