Skip to content

Commit 483f828

Browse files
committed
Merge branch 'master' of github.com:Mast3rwaf1z/homepage
2 parents c5c2a8d + ca3393c commit 483f828

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/Pages/Projects/Projects.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Database.Schema (defs)
1717
import Layout (layout)
1818
import Page (Page, PageSetting (Description, Route), getArgs)
1919
import Pages.Projects.Editor (editor)
20+
import Api.Api (apiMap)
2021

2122
defaultProject :: (String, Html)
2223
defaultProject = ("", section [hsx|
@@ -87,6 +88,12 @@ projectsTree = Tree defaultProject [
8788
<br><br>
8889
This page about projects is actually also pretty cool, its defined as a tree data structure, so i can also easily print it:
8990
{codeBlock "haskell" $ show (Tree ("projects", "<html>") [Tree ("page2", "<html>") [], Tree ("page3", "<html>") [], Tree ("page4", "<html>") []])}
91+
92+
The api is likewise actually implemented as a list of pairs of strings and lists of pairs of strings and functions taking a request and returning a triple as a response.
93+
94+
Below the API will dynamically update the more endpoints i'll add.
95+
{codeBlock "txt" $ intercalate "\n" $ map (\(method, routes) -> method ++ "\n\t/api" ++ (intercalate "\n\t/api" $ map fst routes)) apiMap}
96+
9097
<h2>Versions</h2>
9198
In the sidebar, or below you can choose to read about each version of this website.
9299
</div>
@@ -119,7 +126,7 @@ projectsTree = Tree defaultProject [
119126
This version is also written in haskell, but this time also using Warp directly to translate HSX to blaze and parse blaze to a bytestring. Its this current site and doesn't require a link :P<br>
120127
Source code is available at <a href="https://github.com/Mast3rwaf1z/homepage">https://github.com/Mast3rwaf1z/homepage</a>
121128
<br>
122-
The best feature of this rewrite is that i've combined the backend and the frontend into one, and since HSX allows me to put IO code directly inline with my html, i can access the database directly instead of the frontend sending a million HTTP requests. This means that the website is A LOT faster than the first few iterations, and instead of a lot of content loading at different times, its all loaded at once at the server side, with as little javascript as possible.
129+
The best feature of this rewrite is that i've combined the backend and the frontend into one, and since HSX allows me to put IO code directly inline with my html, i can access the database directly instead of the frontend sending a million HTTP requests. This means that the website is A LOT faster than the first few iterations, and instead of a lot of content loading at different times, its all loaded at once at the server side, with as little javascript as possible.
123130
|]) []
124131
],
125132
Tree ("Skademaskinen", section [hsx|

0 commit comments

Comments
 (0)