| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Tue, 23 Dec 2025 14:25:28 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090630124827
location: https://web.archive.org/web/20090630124827/https://github.com/nfjinjing/loli
server-timing: captures_list;dur=0.684060, exclusion.robots;dur=0.063897, exclusion.robots.policy;dur=0.052098, esindex;dur=0.010367, cdx.remote;dur=17.719747, LoadShardBlock;dur=261.137454, PetaboxLoader3.datanode;dur=177.871636, PetaboxLoader3.resolve;dur=69.709234
x-app-server: wwwb-app242-dc8
x-ts: 302
x-tr: 324
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app242; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 301
server: nginx
date: Tue, 23 Dec 2025 14:25:29 GMT
content-type: text/html; charset=utf-8
content-length: 110
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Tue, 30 Jun 2009 12:48:26 GMT
x-archive-orig-connection: close
x-archive-orig-status: 301 Moved Permanently
location: https://web.archive.org/web/20090630124827/https://github.com/nfjinjing/loli/tree/master
x-archive-orig-x-runtime: 135ms
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 110
cache-control: max-age=1800
memento-datetime: Tue, 30 Jun 2009 12:48:27 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_10_20090630102426_crawl102.gpg-c/52_10_20090630124724_crawl101.arc.gz
server-timing: captures_list;dur=0.812955, exclusion.robots;dur=0.035479, exclusion.robots.policy;dur=0.021813, esindex;dur=0.013788, cdx.remote;dur=5.764546, LoadShardBlock;dur=78.600047, PetaboxLoader3.datanode;dur=97.294677, PetaboxLoader3.resolve;dur=40.857170, load_resource;dur=246.721788
x-app-server: wwwb-app242-dc8
x-ts: 301
x-tr: 364
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Tue, 23 Dec 2025 14:25:29 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Tue, 30 Jun 2009 12:48:26 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 145ms
x-archive-orig-etag: "9fe38b28956308affb4a2c36ed8ae7d7"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 28214
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Tue, 30 Jun 2009 12:48:27 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_10_20090630102426_crawl102.gpg-c/52_10_20090630124724_crawl101.arc.gz
server-timing: captures_list;dur=0.806550, exclusion.robots;dur=0.021655, exclusion.robots.policy;dur=0.013683, esindex;dur=0.010989, cdx.remote;dur=72.548028, LoadShardBlock;dur=125.774776, PetaboxLoader3.datanode;dur=101.255703, PetaboxLoader3.resolve;dur=67.967894, load_resource;dur=71.177721
x-app-server: wwwb-app242-dc8
x-ts: 200
x-tr: 355
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
nfjinjing's loli at master - GitHub
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| Description: | A minimum web dev DSL in Haskell edit |
| Homepage: | edit |
| Public Clone URL: |
git://github.com/nfjinjing/loli.git
Give this clone URL to anyone.
git clone git://github.com/nfjinjing/loli.git
|
| Your Clone URL: |
Use this clone URL yourself.
git clone git@github.com:nfjinjing/loli.git
|
loli /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Mon Jun 29 05:03:43 -0700 2009 | add public resource [nfjinjing] |
| |
LICENSE | Thu Jun 25 05:59:35 -0700 2009 | init [nfjinjing] |
| |
Nemesis | Mon Jun 29 05:15:46 -0700 2009 | add deploy receipt [nfjinjing] |
| |
Setup.lhs | Thu Jun 25 05:59:35 -0700 2009 | init [nfjinjing] |
| |
changelog.md | Mon Jun 29 05:49:16 -0700 2009 | prep hackage release [nfjinjing] |
| |
known-issues.md | Mon Jun 29 05:49:16 -0700 2009 | prep hackage release [nfjinjing] |
| |
loli.cabal | Mon Jun 29 07:13:19 -0700 2009 | add release info [nfjinjing] |
| |
public/ | Mon Jun 29 06:53:34 -0700 2009 | no top line [nfjinjing] |
| |
readme.md | Mon Jun 29 22:00:06 -0700 2009 | why should I explain my own naming of project.. [nfjinjing] |
| |
release.md | Mon Jun 29 07:13:19 -0700 2009 | add release info [nfjinjing] |
| |
src/ | Tue Jun 30 05:27:41 -0700 2009 | only make haskell default selection, instead of... [nfjinjing] |
| |
views/ | Mon Jun 29 06:53:34 -0700 2009 | no top line [nfjinjing] |
loli
A minimum web dev DSL
Example
First app
-- myloli.hs
import Network.Loli
import Hack.Handler.Happstack
main = run . loli $ get "/" (text "loli power")
Install and compile:
cabal update
cabal install loli
cabal install hack-handler-happstack
ghc --make myloli.hs
./myloli
check: https://localhost:3000
Routes
Verbs
get "/" $ do
-- something for a get request
post "/" $ do
-- for a post request
put "/" $ do
-- put ..
delete "/" $ do
-- ..
Captures
get "/say/:user/:message" $ do
text . show =<< captures
-- /say/jinjing/hello will output
-- [("user","jinjing"),("message","hello")]
Static
-- public serve, only allows /src
public (Just ".") ["/src"]
Views root
-- in `./views`, can be changed by
views "template"
Template
Text Template
import Network.Loli.Template.TextTemplate
-- template
get "/hi/:user" $ output (text_template "hello.html")
-- in hello.html
<html>
<title>hello</title>
<body>
<p>hello $user</p>
</body>
</html>
Local binding
get "/local-binding" $ do
bind "user" "alice" $ output (text_template "hello.html")
Batched local bindings
get "/batched-local-binding" $ do
context [("user", "alice"), ("password", "foo")] $
text . show =<< locals
Partials
Partials are treated the same as user supplied bindings, i.e. the rendered text is available to the rest of templates, referenced by user supplied keywords.
with single partial
get "/single-partial" $ do
partial "user" (const_template "const-user") $ do
text . show =<< template_locals
with batched partials
get "/group-partial" $ do
partials
[ ("user", const_template "alex")
, ("password", const_template "foo")
] $ output (text_template "hello.html")
Layout
Local
get "/with-layout" $ do
with_layout "layout.html" $ do
text "layout?"
-- in layout.html
<html>
<body>
<h1>using a layout</h1>
$content
</body>
</html>
Global
layout "layout.html"
By passed
get "/no-layout" $ do
no_layout $ do
text "no-layout"
Mime types
-- treat .hs extension as text/plain
mime "hs" "text/plain"
Hack integration
Use hack middleware
import Hack.Contrib.Middleware.ETag
import Hack.Contrib.Middleware.ShowStatus
middleware etag
middleware show_status
Convert loli into a hack application
-- in Network.Loli.Engine
loli :: Unit -> Application
Note
If you see this, use the git version!
Reference
This feature is coming soon. Sit tight!











