From a1318dd3ebd41d9ce8528a51a8099985fa18f763 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sun, 6 Mar 2016 01:23:56 -0500 Subject: add api-methods and api-content-type --- src/guff/api-content-type.cr | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/guff/api-content-type.cr (limited to 'src/guff/api-content-type.cr') diff --git a/src/guff/api-content-type.cr b/src/guff/api-content-type.cr new file mode 100644 index 0000000..9b6c74a --- /dev/null +++ b/src/guff/api-content-type.cr @@ -0,0 +1,12 @@ +module Guff + module APIContentType + CONTENT_TYPES = { + "development": "text/html; charset=utf-8", + "production": "application/json; charset=utf8", + } + + private def get_content_type + CONTENT_TYPES[@model.config["environment"]] + end + end +end -- cgit v1.2.3