Skip to content

Commit afcd9ff

Browse files
Merge branch 'main' into bump/deps-2024-07
2 parents 6a53720 + 04413a3 commit afcd9ff

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

resources/config.edn

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
:host #or [#env DB_HOST "localhost"]
1111
:port #or [#env DB_PORT 5432]}
1212

13-
:db-docs {:dir "target"
14-
:url "https://github.com/clj-codes/docs.extractor/releases/download"
15-
:version "v0.3.4"
16-
:file-name "docs-db.zip"}
13+
:db-docs {:dir #or [#env DB_DOCS_DIR "target"]
14+
:url #or [#env DB_DOCS_URL "https://github.com/clj-codes/docs.extractor/releases/download"]
15+
:version #or [#env DB_DOCS_VERSION "v0.3.4"]
16+
:file-name #or [#env DB_DOCS_FILE_NAME "docs-db.zip"]}
1717

1818
:github {:client {:id #or [#env GH_CLIENT_ID "app-client-id"]
1919
:secret #or [#env GH_CLIENT_SECRET "app-client-secret"]}}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(ns codes.clj.docs.backend.ports.http-in.ops)
2+
3+
(defn health
4+
[_]
5+
{:status 200 :body "OK"})

src/codes/clj/docs/backend/routes.clj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(ns codes.clj.docs.backend.routes
22
(:require [codes.clj.docs.backend.interceptors :as backend.interceptors]
33
[codes.clj.docs.backend.ports.http-in.document :as ports.http-in.document]
4+
[codes.clj.docs.backend.ports.http-in.ops :as ports.http-in.ops]
45
[codes.clj.docs.backend.ports.http-in.social :as ports.http-in.social]
56
[codes.clj.docs.backend.schemas.wire.in.social :as schemas.wire.in.social]
67
[codes.clj.docs.backend.schemas.wire.out.document :as schemas.wire.out.document]
@@ -15,6 +16,15 @@
1516
:description "codes.clj.docs.backend"}}
1617
:handler (swagger/create-swagger-handler)}}]
1718

19+
["/ops"
20+
{:swagger {:tags ["ops"]}}
21+
22+
["/health"
23+
{:get {:summary "health check"
24+
:responses {200 {:body :string}
25+
500 {:body :string}}
26+
:handler ports.http-in.ops/health}}]]
27+
1828
["/api"
1929

2030
["/login"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
(ns integration.codes.clj.docs.backend.ops-test
2+
(:require [clojure.test :refer [use-fixtures]]
3+
[integration.codes.clj.docs.backend.util :as util]
4+
[parenthesin.helpers.malli :as helpers.malli]
5+
[parenthesin.helpers.state-flow.server.pedestal :as state-flow.server]
6+
[state-flow.api :refer [defflow flow]]
7+
[state-flow.assertions.matcher-combinators :refer [match?]]))
8+
9+
(use-fixtures :once helpers.malli/with-intrumentation)
10+
11+
(defflow
12+
flow-integration-ops-test
13+
{:init util/start-system!
14+
:cleanup util/stop-system!
15+
:fail-fast? true}
16+
(flow "should interact with system"
17+
(flow "health check"
18+
(match? {:status 200 :body "OK"}
19+
(state-flow.server/request! {:method :get
20+
:uri "/ops/health"})))))

0 commit comments

Comments
 (0)