diff --git a/app/controllers/github_pocs_controller.rb b/app/controllers/github_pocs_controller.rb new file mode 100644 index 0000000..79861ca --- /dev/null +++ b/app/controllers/github_pocs_controller.rb @@ -0,0 +1,16 @@ +class GithubPocsController < ApplicationController + def index + @pocs = GithubPoc.all + end + + def show + @poc = GithubPoc.find_by(:id => params[:id]) + render json: @poc.to_json + end + + def show_for_cve + @poc = GithubPoc.where(:cve_id => params[:cve_id]) + render json: @poc.to_json + end + +end diff --git a/app/views/github_pocs/index.html.erb b/app/views/github_pocs/index.html.erb new file mode 100644 index 0000000..864544d --- /dev/null +++ b/app/views/github_pocs/index.html.erb @@ -0,0 +1 @@ +

GithubPocs#index

diff --git a/app/views/github_pocs/show.html.erb b/app/views/github_pocs/show.html.erb new file mode 100644 index 0000000..740ff12 --- /dev/null +++ b/app/views/github_pocs/show.html.erb @@ -0,0 +1,2 @@ +

@poc

+ diff --git a/config/routes.rb b/config/routes.rb index 4abadb2..cd68446 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,4 +6,8 @@ Rails.application.routes.draw do get "/cpes", to: "cpes#index" get "/cpes/:id", to: "cpes#show" + + get "/github_pocs", to: "github_pocs#index" + get "/github_pocs/:id", to: "github_pocs#show" + get "/github_pocs/cve/:cve_id", to: "github_pocs#show_for_cve" end