-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add HTTP server and prototype interface.
- Loading branch information
Showing
10 changed files
with
181 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
|
||
databases/ | ||
notes/ | ||
downloads/ | ||
.clj-kondo/ | ||
resources/config.edn | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Simmie</title> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"> | ||
<style> | ||
body, html { | ||
height: 100%; | ||
margin: 0; | ||
} | ||
.full-height { | ||
height: 100%; | ||
} | ||
.content { | ||
color: black; | ||
background-color: white; | ||
padding: 20px; | ||
margin: 20px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<section class="hero is-fullheight"> | ||
<div class="hero-head"> | ||
<header class="navbar"> | ||
<div class="container"> | ||
<div id="navbarMenu" class="navbar-menu"> | ||
<div class="navbar-start"> | ||
<a class="navbar-item" href="#">Home</a> | ||
<a class="navbar-item" href="#">Features</a> | ||
<a class="navbar-item" href="#">About</a> | ||
</div> | ||
</div> | ||
<div class="navbar-brand"> | ||
<a class="navbar-item" href="/"> | ||
<img src="simmie.png" alt="Simmie logo"> | ||
</a> | ||
<span class="navbar-burger" data-target="navbarMenu"> | ||
<span></span> | ||
<span></span> | ||
<span></span> | ||
</span> | ||
</div> | ||
</div> | ||
</header> | ||
</div> | ||
<div class="hero-body"> | ||
<div class="container has-text-centered"> | ||
<div class="content"> | ||
<h1>Hey!</h1> | ||
<p>Simmie is a conversational AI system that combines different forms of intelligence to help you pursue your goals or just have fun.</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="hero-foot"> | ||
<footer class="footer"> | ||
<div class="content has-text-centered"> | ||
<p>Copyright © 2024 Christian Weilbach. All rights reserved.</p> | ||
</div> | ||
</footer> | ||
</div> | ||
</section> | ||
<script> | ||
document.addEventListener('DOMContentLoaded', () => { | ||
// Get all "navbar-burger" elements | ||
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0); | ||
|
||
// Check if there are any navbar burgers | ||
if ($navbarBurgers.length > 0) { | ||
|
||
// Add a click event on each of them | ||
$navbarBurgers.forEach(el => { | ||
el.addEventListener('click', () => { | ||
|
||
// Get the target from the "data-target" attribute | ||
const target = el.dataset.target; | ||
const $target = document.getElementById(target); | ||
|
||
// Toggle the "is-active" class on both the "navbar-burger" and the targeted "navbar-menu" | ||
el.classList.toggle('is-active'); | ||
$target.classList.toggle('is-active'); | ||
|
||
}); | ||
}); | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
(ns ie.simm.http | ||
(:require [muuntaja.core :as m] | ||
[reitit.ring :as ring] | ||
[reitit.coercion.spec] | ||
[reitit.ring.coercion :as rrc] | ||
[reitit.ring.middleware.muuntaja :as muuntaja] | ||
[reitit.ring.middleware.parameters :as parameters])) | ||
|
||
(defn website-routes [] | ||
[["/hello" {:get (fn [request] | ||
{:status 200 | ||
:body "Hello, world!"})}]]) | ||
|
||
(defn ring-handler [routes] | ||
(let [routes (concat (vec (apply concat (vals routes))) (website-routes))] | ||
(prn "ROUTES" routes) | ||
(ring/ring-handler | ||
(ring/router | ||
routes | ||
{:data {:coercion reitit.coercion.spec/coercion | ||
:muuntaja m/instance | ||
:middleware [parameters/parameters-middleware | ||
rrc/coerce-request-middleware | ||
muuntaja/format-response-middleware | ||
rrc/coerce-response-middleware]}}) | ||
(ring/routes | ||
(ring/create-resource-handler {:path "/"}) | ||
(ring/create-default-handler))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters