Rails.application.routes.draw do # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. # Can be used by load balancers and uptime monitors to verify that the app is live. get "up" => "rails/health#show", as: :rails_health_check # WAF API namespace :api, defaults: { format: :json } do # Event ingestion post ":project_id/events", to: "events#create" # Rule synchronization get ":public_key/rules/version", to: "rules#version" get ":public_key/rules", to: "rules#index" end # Root path - projects dashboard root "projects#index" # Project management resources :projects, only: [:index, :new, :create, :show, :edit, :update] do resources :events, only: [:index] member do get :analytics end end # Rule management resources :rule_sets, only: [:index, :new, :create, :show, :edit, :update] do member do post :push_to_agents end end end