aboutsummaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-01-28 14:46:03 +0000
committerChristopher Baines <mail@cbaines.net>2018-03-29 07:28:09 +0100
commit97f6d7e326a1fd7ddcbe7cf32dc0e4c0a508913d (patch)
treefa2dceba69676cd0a2d35840fea69eb1422b52bd /app/controllers
parenteb3177b0d8de10f316ac595dff3b8165cf828796 (diff)
downloadgovuk-mini-environment-admin-97f6d7e326a1fd7ddcbe7cf32dc0e4c0a508913d.tar
govuk-mini-environment-admin-97f6d7e326a1fd7ddcbe7cf32dc0e4c0a508913d.tar.gz
Add terraform backend and initial guix configuration
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/terraform_http_backend_controller.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/controllers/terraform_http_backend_controller.rb b/app/controllers/terraform_http_backend_controller.rb
new file mode 100644
index 0000000..6b94d8d
--- /dev/null
+++ b/app/controllers/terraform_http_backend_controller.rb
@@ -0,0 +1,25 @@
+class TerraformHttpBackendController < ApplicationController
+ skip_before_action :verify_authenticity_token
+
+ def create
+ TerraformState.create(data: params)
+
+ render json: '{ "success": true }', status: 200
+ end
+
+ def show
+ state = TerraformState.last
+
+ if state.nil?
+ render json: '{}', status: 404
+ else
+ render json: state.data, status: 200
+ end
+ end
+
+ def destroy
+ TerraformState.delete_all
+
+ render json: '{ "success": true }', status: 200
+ end
+end