routes.rb 604 B

123456789101112131415161718192021222324
  1. # frozen_string_literal: true
  2. Rails.application.routes.draw do
  3. if Rails.env.development?
  4. mount GraphiQL::Rails::Engine,
  5. at: '/-/graphiql',
  6. graphql_path: '/api/graphql'
  7. end
  8. devise_for :users,
  9. controllers: {
  10. omniauth_callbacks: 'users/omniauth_callbacks',
  11. registrations: 'users/registrations',
  12. }
  13. root to: 'welcome#root'
  14. namespace :api, defaults: {formats: :json} do
  15. post '/graphql', to: 'graphql#execute'
  16. match '*path', to: 'application#not_found', via: :all
  17. end
  18. get '*path', to: 'welcome#root'
  19. end