routes.rb 520 B

123456789101112131415161718192021
  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: {omniauth_callbacks: 'users/omniauth_callbacks'}
  10. root to: 'welcome#root'
  11. namespace :api, defaults: {formats: :json} do
  12. post '/graphql', to: 'graphql#execute'
  13. match '*path', to: 'application#not_found', via: :all
  14. end
  15. get '*path', to: 'welcome#root'
  16. end