This repository has been archived by the owner on Oct 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
launch.hl
61 lines (45 loc) · 1.48 KB
/
launch.hl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* File responsible for launching Hypereval.
*
* Notice, this file also seconds as a URL resolver for evaluating _"page"_ Hypereval snippets.
* To load a page Hypereval snippet simply add the name of your snippet as the second part of your
* URL, and it will load that snippet as a page, instead of launching
* Hypereval itself. Example `/hypereval/some-page-snippet`.
*/
/*
* Signal node, to separate arguments from the rest of lambda.
*/
.signal
/*
* Checking if this is a request for a specific "page" snippet.
*/
micro.url.get-entities
if:x:/@micro.url.get-entities/*?count
>:int:1
/*
* This is a request for a "page snippet".
*
* Evaluating snippet, making sure we wrap our evaluation in a try/catch block,
* such that we can return intelligent error feedback to client if snippet doesn't exist.
*/
try
/*
* Invoking event responsible for evaluating the requests page snippet.
*/
hypereval.snippets.evaluate:x:/@micro.url.get-entities/1?name
type:page
catch
/*
* No such snippet found.
*/
p5.web.response.set-status-code:404
p5.web.response.set-status-description:404 - No such functioning snippet found
p5.web.echo:x:/@message?value
else
/*
* This is not a request for a specific page, hence we load up main wireframe for
* Hypereval.
*/
add:x:/+
src:x:/@.signal/--/<-
micro.evaluate.file:@HYPEREVAL/helpers/launch-hypereval.hl