Files
baffle-hub/config/routes.rb
2025-11-04 09:47:11 +11:00

37 lines
1.0 KiB
Ruby

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 :rules, only: [:index, :new, :create, :show, :edit, :update] do
member do
post :disable
post :enable
end
end
end