Commit c81bacdd860cbfeb4079b7ee70620891cf563023

Authored by Georg Hopp
1 parent 41d846f9

add pages controller to enable letsencrypt for the project

  1 +# Place all the behaviors and hooks related to the matching controller here.
  2 +# All this logic will automatically be available in application.js.
  3 +# You can use CoffeeScript in this file: http://coffeescript.org/
... ...
  1 +// Place all the styles related to the Pages controller here.
  2 +// They will automatically be included in application.css.
  3 +// You can use Sass (SCSS) here: http://sass-lang.com/
... ...
  1 +class PagesController < ApplicationController
  2 + def letsencrypt
  3 + render text: "key goes here..."
  4 + end
  5 +end
  6 +# vim: set ts=2 sw=2:
... ...
  1 +module PagesHelper
  2 +end
... ...
  1 +<h1>Pages#letsencrypt</h1>
  2 +<p>Find me in app/views/pages/letsencrypt.html.erb</p>
... ...
1 1 Rails.application.routes.draw do
  2 + get 'pages/letsencrypt'
  3 +
2 4 get 'welcome/index'
3 5
4 6 # The priority is based upon order of creation: first created -> highest priority.
... ... @@ -7,6 +9,10 @@ Rails.application.routes.draw do
7 9 # You can have the root of your site routed with "root"
8 10 root 'welcome#index'
9 11
  12 + # Static pages controller
  13 + # controller for letsencrypt
  14 + get '/.well-known/acme-challenge/:id' => 'pages#letsencrypt'
  15 +
10 16 # Example of regular route:
11 17 # get 'products/:id' => 'catalog#view'
12 18
... ...
  1 +require 'test_helper'
  2 +
  3 +class PagesControllerTest < ActionController::TestCase
  4 + test "should get letsencrypt" do
  5 + get :letsencrypt
  6 + assert_response :success
  7 + end
  8 +
  9 +end
... ...
Please register or login to post a comment