added controller and view for github_poc

This commit is contained in:
Brendan McDevitt 2022-04-05 22:22:23 -05:00
parent b91923a9e4
commit bc06defa7c
4 changed files with 23 additions and 0 deletions

View file

@ -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

View file

@ -0,0 +1 @@
<h1>GithubPocs#index</h1>

View file

@ -0,0 +1,2 @@
<h1> @poc </h1>

View file

@ -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