forked from lemon-lang/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lm
42 lines (34 loc) · 791 Bytes
/
main.lm
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
import 'http.lm';
class IndexHandler(http.HTTPHandler) {
def GET() {
return self.render('template/index.html');
}
}
class DocumentationHandler(http.HTTPHandler) {
def GET() {
return self.render('template/documentation.html');
}
}
class DownloadsHandler(http.HTTPHandler) {
def GET() {
return self.render('template/downloads.html');
}
}
class LibrariesHandler(http.HTTPHandler) {
def GET() {
return self.render('template/libraries.html');
}
}
def main() {
var handlers = {
'/': IndexHandler,
'/documentation': DocumentationHandler,
'/downloads': DownloadsHandler,
'/libraries': LibrariesHandler,
'/static/.*$': http.HTTPStaticFileHandler,
};
var app = http.HTTPApplication(handlers);
var server = http.HTTPServer(app);
server.serve_forever();
}
main();