2022-04-04 13:18:03 -05:00
|
|
|
class CvesController < ApplicationController
|
|
|
|
def index
|
|
|
|
@cves = Cve.all
|
2022-04-11 20:53:20 -05:00
|
|
|
render json: @cves.to_json
|
2022-04-04 13:18:03 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
|
|
|
@cve = Cve.find_by_id(params[:cve_id])
|
|
|
|
render json: @cve.to_json
|
|
|
|
end
|
|
|
|
|
|
|
|
def show_year
|
2022-04-05 12:33:51 -05:00
|
|
|
@cves_for_year = Cve.from_year(params[:year])
|
2022-04-05 12:36:32 -05:00
|
|
|
render json: @cves_for_year.to_json
|
2022-04-04 13:18:03 -05:00
|
|
|
end
|
|
|
|
end
|