diff --git a/app/assets/javascripts/pages.coffee b/app/assets/javascripts/pages.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/pages.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/pages.scss b/app/assets/stylesheets/pages.scss new file mode 100644 index 0000000..31cb8fb --- /dev/null +++ b/app/assets/stylesheets/pages.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Pages controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb new file mode 100644 index 0000000..072acb1 --- /dev/null +++ b/app/controllers/pages_controller.rb @@ -0,0 +1,6 @@ +class PagesController < ApplicationController + def letsencrypt + render text: "key goes here..." + end +end +# vim: set ts=2 sw=2: diff --git a/app/helpers/pages_helper.rb b/app/helpers/pages_helper.rb new file mode 100644 index 0000000..2c057fd --- /dev/null +++ b/app/helpers/pages_helper.rb @@ -0,0 +1,2 @@ +module PagesHelper +end diff --git a/app/views/pages/letsencrypt.html.erb b/app/views/pages/letsencrypt.html.erb new file mode 100644 index 0000000..7b3acca --- /dev/null +++ b/app/views/pages/letsencrypt.html.erb @@ -0,0 +1,2 @@ +

Pages#letsencrypt

+

Find me in app/views/pages/letsencrypt.html.erb

diff --git a/config/routes.rb b/config/routes.rb index f336c96..58dd04b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,6 @@ Rails.application.routes.draw do + get 'pages/letsencrypt' + get 'welcome/index' # The priority is based upon order of creation: first created -> highest priority. @@ -7,6 +9,10 @@ Rails.application.routes.draw do # You can have the root of your site routed with "root" root 'welcome#index' + # Static pages controller + # controller for letsencrypt + get '/.well-known/acme-challenge/:id' => 'pages#letsencrypt' + # Example of regular route: # get 'products/:id' => 'catalog#view' diff --git a/test/controllers/pages_controller_test.rb b/test/controllers/pages_controller_test.rb new file mode 100644 index 0000000..cda4aa9 --- /dev/null +++ b/test/controllers/pages_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class PagesControllerTest < ActionController::TestCase + test "should get letsencrypt" do + get :letsencrypt + assert_response :success + end + +end