]> git.frustrated-labs.net Git - larousseapi/commitdiff
feat: add API documentation section
authorAlexander Goussas <[email protected]>
Sun, 31 May 2026 20:42:32 +0000 (15:42 -0500)
committerAlexander Goussas <[email protected]>
Sun, 31 May 2026 20:42:32 +0000 (15:42 -0500)
collections/larousse API/Define a word.yml
collections/larousse API/Translate a word.yml
src/main/resources/templates/pub/api.html [new file with mode: 0644]

index bf0eea8b0008f61d5499d8c2048ff9c49d07445b..96fcef16aa2812ac2a0cf7f02ae1bdea879fc849 100644 (file)
@@ -8,7 +8,7 @@ http:
   url: "{{api.base_url}}/words/:word/definition"
   params:
     - name: word
-      value: chien
+      value: voiture
       type: path
   auth: inherit
 
index dc7cbf16637903ae4e9606014cd799861b70ed9e..9f08930b082d935152d244bc29bb23906178e914 100644 (file)
@@ -8,7 +8,7 @@ http:
   url: "{{api.base_url}}/words/:word/translation"
   params:
     - name: word
-      value: grenouille
+      value: voiture
       type: path
   auth: inherit
 
diff --git a/src/main/resources/templates/pub/api.html b/src/main/resources/templates/pub/api.html
new file mode 100644 (file)
index 0000000..01b99a5
--- /dev/null
@@ -0,0 +1,92 @@
+{@net.frustratedfunctor.ui.WordTranslationsDefinitions  translationsDefinitions}
+<!DOCTYPE html>
+<html lang="en">
+<meta charset="UTF-8">
+<meta name="description" content="Translations and definitions service for French and English">
+<title>Frustrated Langs | Contributing</title>
+<meta name="viewport" content="width=device-width,initial-scale=1">
+<script defer src="https://analytics.frustrated-labs.net/script.js"
+        data-website-id="ac647826-77cd-48d0-b184-2da490b4adb4"></script>
+<script defer src="https://analytics.frustrated-labs.net/recorder.js"
+        data-website-id="ac647826-77cd-48d0-b184-2da490b4adb4" data-sample-rate="0.15" data-mask-level="moderate"
+        data-max-duration="300000"></script>
+<link rel="stylesheet" href="/styles.css">
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/picnic">
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css"
+      integrity="sha512-2SwdPD6INVrV/lHTZbO2nodKhrnDdJK9/kg2XD1r9uGqPo1cUbujc+IYdlYdEErWNu69gVcYgdxlmVmzTWnetw=="
+      crossorigin="anonymous" referrerpolicy="no-referrer"/>
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/solid.min.css"
+      integrity="sha512-EHa6vH03/Ty92WahM0/tet1Qicl76zihDCkBnFhN3kFGQkC+mc86d7V+6y2ypiLbk3h0beZAGdUpzfMcb06cMg=="
+      crossorigin="anonymous" referrerpolicy="no-referrer"/>
+<style>
+</style>
+<body>
+
+<header>
+    <nav class="demo">
+        <a href="#" class="brand">
+            <img class="logo" src="/logo.png" alt="logo"/>
+            <span>Frustrated Langs</span>
+        </a>
+
+        <!-- responsive-->
+        <input id="bmenub" type="checkbox" class="show">
+        <label for="bmenub" class="burger pseudo button">&#8801;</label>
+
+        <div class="menu">
+            <a href="/about.html" class="pseudo button">About</a>
+            <a href="/api.html" class="pseudo button">API</a>
+            <a href="/contributing.html" class="button">Contribute</a>
+        </div>
+    </nav>
+</header>
+
+<main class="">
+    <h1>API Docs</h1>
+    <p>
+        I write this documentation by hand, since the API is rather petit. Nonetheless, that means it could drift from
+        the actual implementation. So if anything is not working according to this documentation, please report it at
+        <a href="mailto:[email protected]">[email protected]</a> with the subject
+        <code>[larousseapi] DOCS: description</code>.
+    </p>
+    <h2><code>/GET</code> word translations</h2>
+    <h3>Example cURL</h3>
+    <pre>
+curl --request GET \
+    --url $API_BASE/words/:word/translation</pre>
+    <h3>Example response</h3>
+    <pre>
+{
+  "word": "voiture",
+  "translations": [
+    "car,",
+    "coach,",
+    "carriage,"
+  ]
+}</pre>
+    <h2><code>/GET</code> word definitions</h2>
+    <h3>Example cURL</h3>
+    <pre>
+curl --request GET \
+    --url $API_BASE/words/:word/definition</pre>
+    <h3>Example response</h3>
+    <pre>
+{
+  "word": "voiture",
+  "definitions": [
+    "Véhicule susceptible de conduire, porter ou transporter des personnes ou des marchandises :",
+    "Automobile :",
+    "Véhicule ferroviaire destiné au transport des voyageurs (par opposition au , utilisé pour le transport des marchandises).",
+    "Chargement d'un véhicule, d'un camion, etc. :"
+  ]
+}</pre>
+</main>
+
+<footer>
+    <small>Copyright 2026 Alexander Goussas</small>
+    <br>
+    <small>Made with Quarkus and k8s and <3</small>
+</footer>
+
+</body>
+</html>
\ No newline at end of file