From e7e517b822333188ea34f4a4ba83de2253cfe869 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sat, 6 Apr 2024 11:48:32 +0100 Subject: Reorganises cmd/ structure for publication on pkg.go.dev Adds key commands to Makefile --- cmd/api/healthcheck.go | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 cmd/api/healthcheck.go (limited to 'cmd/api/healthcheck.go') diff --git a/cmd/api/healthcheck.go b/cmd/api/healthcheck.go deleted file mode 100644 index 3378c6e..0000000 --- a/cmd/api/healthcheck.go +++ /dev/null @@ -1,36 +0,0 @@ -// dbasik provides a service with which to convert spreadsheets containing -// data to JSON for further processing. - -// Copyright (C) 2024 M R Lemon - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -package main - -import ( - "net/http" -) - -func (app *application) healthcheckHandler(w http.ResponseWriter, r *http.Request) { - env := envelope{ - "status": "available", - "system_info": map[string]string{ - "environment": app.config.env, - "version": version, - }, - } - err := app.writeJSON(w, http.StatusOK, env, nil) - if err != nil { - app.serverErrorResponse(w, r, err) - } -} -- cgit v1.2.3