diff --git a/evaldo/builtins_smtpd.go b/evaldo/builtins_smtpd.go index 0a893565..8827a8f5 100755 --- a/evaldo/builtins_smtpd.go +++ b/evaldo/builtins_smtpd.go @@ -16,7 +16,7 @@ import ( var Builtins_smtpd = map[string]*env.Builtin{ - "new-smtpd": { + "smtp-server": { Argsn: 1, Doc: "Creates SMTP server", Fn: func(ps *env.ProgramState, arg0 env.Object, arg1 env.Object, arg2 env.Object, arg3 env.Object, arg4 env.Object) env.Object { diff --git a/examples/examples-wip/main_0.6.rye b/examples/examples-wip/main_0.6.rye index 550c068e..85fc3018 100644 --- a/examples/examples-wip/main_0.6.rye +++ b/examples/examples-wip/main_0.6.rye @@ -52,6 +52,6 @@ handle-api: fn { w r } { } } -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/examples-wip/websockets_chat.rye b/examples/examples-wip/websockets_chat.rye index 0f1cddbc..50271d11 100644 --- a/examples/examples-wip/websockets_chat.rye +++ b/examples/examples-wip/websockets_chat.rye @@ -23,6 +23,6 @@ hub: fn { e } { go-with event ?hub -new-server ":8080" +http-server ":8080" |handle-ws "/chat" ?handle-chat |serve diff --git a/examples/examples-wip/websockets_chat_A.rye b/examples/examples-wip/websockets_chat_A.rye index 52e3159c..6dc7fe08 100644 --- a/examples/examples-wip/websockets_chat_A.rye +++ b/examples/examples-wip/websockets_chat_A.rye @@ -19,6 +19,6 @@ hub: fn { e } { go-with event ?hub -new-server ":8080" +http-server ":8080" |handle-ws "/chat" ?handle-chat |serve diff --git a/examples/examples-wip/websockets_chat_b.rye b/examples/examples-wip/websockets_chat_b.rye index c20f0272..09b2aa1e 100644 --- a/examples/examples-wip/websockets_chat_b.rye +++ b/examples/examples-wip/websockets_chat_b.rye @@ -35,6 +35,6 @@ hub: fn { e } { go-with event ?hub -new-server ":8080" +http-server ":8080" |handle-ws "/chat" ?handle-chat |serve diff --git a/examples/examples-wip/websockets_chat_c.rye b/examples/examples-wip/websockets_chat_c.rye index a132ec4d..f0a7ea45 100644 --- a/examples/examples-wip/websockets_chat_c.rye +++ b/examples/examples-wip/websockets_chat_c.rye @@ -19,6 +19,6 @@ hub: fn { ch } { go-with events ?hub -new-server ":8080" +http-server ":8080" |handle-ws "/chat" ?handle-chat |serve diff --git a/examples/webapp_1/main.rye b/examples/webapp_1/main.rye index 32df8d15..2012b3da 100644 --- a/examples/webapp_1/main.rye +++ b/examples/webapp_1/main.rye @@ -76,7 +76,7 @@ handle-private-api: fn { s c } { } } -new-server ":8080" +http-server ":8080" |handle "/pub-api" ?handle-public-api |handle "/priv-api" ?handle-private-api |handle-files-from "/" %static/ diff --git a/examples/webapp_1/main0.6.rye b/examples/webapp_1/main0.6.rye index eb2ebcb4..56194770 100644 --- a/examples/webapp_1/main0.6.rye +++ b/examples/webapp_1/main0.6.rye @@ -44,6 +44,6 @@ handle-api: fn { w r } { } } -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webapp_1/main_0.1.rye b/examples/webapp_1/main_0.1.rye index eef118a8..cdacdd8b 100644 --- a/examples/webapp_1/main_0.1.rye +++ b/examples/webapp_1/main_0.1.rye @@ -14,6 +14,6 @@ handle-api: fn { w r } { write w "Hiiii!" } -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webapp_1/main_0.2.rye b/examples/webapp_1/main_0.2.rye index dcf7aa6f..14a4ac37 100644 --- a/examples/webapp_1/main_0.2.rye +++ b/examples/webapp_1/main_0.2.rye @@ -19,6 +19,6 @@ handle-api: fn { w r } { print hello-resource -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webapp_1/main_0.3.rye b/examples/webapp_1/main_0.3.rye index c420e858..0cf8260b 100644 --- a/examples/webapp_1/main_0.3.rye +++ b/examples/webapp_1/main_0.3.rye @@ -27,6 +27,6 @@ handle-api: fn { w r } { print hello-resource -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webapp_1/main_0.4.rye b/examples/webapp_1/main_0.4.rye index c420e858..0cf8260b 100644 --- a/examples/webapp_1/main_0.4.rye +++ b/examples/webapp_1/main_0.4.rye @@ -27,6 +27,6 @@ handle-api: fn { w r } { print hello-resource -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webapp_1/main_0.5.rye b/examples/webapp_1/main_0.5.rye index 7473025b..843f1b02 100644 --- a/examples/webapp_1/main_0.5.rye +++ b/examples/webapp_1/main_0.5.rye @@ -46,6 +46,6 @@ handle-api: fn { w r } { } } -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webapp_1/main_0.6.rye b/examples/webapp_1/main_0.6.rye index 550c068e..85fc3018 100644 --- a/examples/webapp_1/main_0.6.rye +++ b/examples/webapp_1/main_0.6.rye @@ -52,6 +52,6 @@ handle-api: fn { w r } { } } -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webapp_1/main_0.rye b/examples/webapp_1/main_0.rye index 9ff39f68..678d972a 100644 --- a/examples/webapp_1/main_0.rye +++ b/examples/webapp_1/main_0.rye @@ -44,6 +44,6 @@ handle-api: fn { w r } { } } -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webapp_1/main_1.rye b/examples/webapp_1/main_1.rye index c0daf12e..0025ce7e 100644 --- a/examples/webapp_1/main_1.rye +++ b/examples/webapp_1/main_1.rye @@ -31,6 +31,6 @@ handle-public-api: fn { s c } { } } -new-server ":8080" +http-server ":8080" |handle "/pub-api" ?handle-public-api |serve diff --git a/examples/webapp_1/main_real_1.rye b/examples/webapp_1/main_real_1.rye index 32df8d15..2012b3da 100644 --- a/examples/webapp_1/main_real_1.rye +++ b/examples/webapp_1/main_real_1.rye @@ -76,7 +76,7 @@ handle-private-api: fn { s c } { } } -new-server ":8080" +http-server ":8080" |handle "/pub-api" ?handle-public-api |handle "/priv-api" ?handle-private-api |handle-files-from "/" %static/ diff --git a/examples/webapp_2/main_0.6.rye b/examples/webapp_2/main_0.6.rye index f79f6169..7666d290 100644 --- a/examples/webapp_2/main_0.6.rye +++ b/examples/webapp_2/main_0.6.rye @@ -66,6 +66,6 @@ handle-api: fn { w r } { db: open postgres://webapp2:password@webapp2 -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webapp_2/main_0.7.rye b/examples/webapp_2/main_0.7.rye index 8dcb6532..cf2b0ba9 100644 --- a/examples/webapp_2/main_0.7.rye +++ b/examples/webapp_2/main_0.7.rye @@ -77,7 +77,7 @@ db: open postgres://webapp2:password@/webapp2 ; the server -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webapp_2/main_0.8.rye b/examples/webapp_2/main_0.8.rye index 6e3056a1..baff4cb0 100644 --- a/examples/webapp_2/main_0.8.rye +++ b/examples/webapp_2/main_0.8.rye @@ -82,7 +82,7 @@ db: open postgres://webapp2:password@/webapp2 ; the server -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webapp_4/webserver.rye b/examples/webapp_4/webserver.rye index 33ddef75..f74eb712 100644 --- a/examples/webapp_4/webserver.rye +++ b/examples/webapp_4/webserver.rye @@ -14,7 +14,7 @@ handle-api: fn { w r } { ; the server -new-server ":8080" +http-server ":8080" |handle "/" fn { w req } { write w page "Demo" "Use the /api, Luke" } |handle "/api" ?handle-api |serve diff --git a/examples/webapp_spacememo/main.rye b/examples/webapp_spacememo/main.rye index 6e3d38e7..328039e1 100644 --- a/examples/webapp_spacememo/main.rye +++ b/examples/webapp_spacememo/main.rye @@ -39,7 +39,7 @@ sess: "main-session" ; the server -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webapp_spacememo/main_0.9.rye b/examples/webapp_spacememo/main_0.9.rye index 0826c731..ad62b8aa 100644 --- a/examples/webapp_spacememo/main_0.9.rye +++ b/examples/webapp_spacememo/main_0.9.rye @@ -130,7 +130,7 @@ sess: "main-session" ; the server -new-server ":8080" +http-server ":8080" |handle "/api" ?handle-api |serve diff --git a/examples/webserver/ctrl_download.rye b/examples/webserver/ctrl_download.rye index 1b4a0fd3..b9a6427c 100644 --- a/examples/webserver/ctrl_download.rye +++ b/examples/webserver/ctrl_download.rye @@ -38,7 +38,7 @@ handle-file-get: fn { w r } { } ; setup the server -new-server ":8080" +http-server ":8080" |handle "/get" ?handle-file-get |handle "/" new-static-handler %www |serve diff --git a/examples/webserver/ctrl_download_nocomm.rye b/examples/webserver/ctrl_download_nocomm.rye index 6021030e..a431b4a6 100644 --- a/examples/webserver/ctrl_download_nocomm.rye +++ b/examples/webserver/ctrl_download_nocomm.rye @@ -26,7 +26,7 @@ handle-file-get: fn { w r } { file .copy w } -new-server ":8080" +http-server ":8080" |handle "/get" ?handle-file-get |serve @@ -59,7 +59,7 @@ new-server ":8080" ; |send-file\attachment w "application/x-pkcs12" "mycert.p12" ; } -; new-server ":8080" +; http-server ":8080" ; |flaskish-handle "/get" ?get-file ; |serve diff --git a/examples/webserver/hello.rye b/examples/webserver/hello.rye index 773b91b6..7bb6266f 100644 --- a/examples/webserver/hello.rye +++ b/examples/webserver/hello.rye @@ -3,7 +3,7 @@ rye .needs { http } -new-server ":8081" +http-server ":8081" |handle "/hello" fn { w r } { .write "Hello world" } |serve diff --git a/examples/webserver/main.rye b/examples/webserver/main.rye index c4334721..05f63910 100644 --- a/examples/webserver/main.rye +++ b/examples/webserver/main.rye @@ -7,13 +7,13 @@ rye .needs { http } ; serve hello world -new-server ":8081" +http-server ":8081" |handle "/hello" fn { w r } { .write "Hello world" } |serve ; serve all static files from www folder -new-server ":8080" +http-server ":8080" |handle "/" new-static-handler %www ; TODO rename, integrate http-dir |serve @@ -22,7 +22,7 @@ new-server ":8080" sh: new-static-handler %static -new-server ":8082" +http-server ":8082" |handle "/static/" sh |handle "/" fn { w r } { .write now } |serve @@ -37,7 +37,7 @@ get-user: fn { w r } { |to-json |write* w } -new-server ":8080" +http-server ":8080" |handle "/user/" get-user |serve @@ -51,7 +51,7 @@ upload: fn { w r } { copy holder file } -new-server ":8080" +http-server ":8080" |handle "/" new-static-handler %www |handle "/upload" ?upload |serve diff --git a/examples/webserver/public_html.rye b/examples/webserver/public_html.rye index 6fd85048..f5d1538e 100644 --- a/examples/webserver/public_html.rye +++ b/examples/webserver/public_html.rye @@ -3,7 +3,7 @@ rye .needs { http } -new-server ":8082" +http-server ":8082" |handle "/" new-static-handler %public_html |serve diff --git a/examples/webserver/static_folder.rye b/examples/webserver/static_folder.rye index f79ca49d..fabb2f60 100644 --- a/examples/webserver/static_folder.rye +++ b/examples/webserver/static_folder.rye @@ -6,7 +6,7 @@ rye .needs { http } sh: new-static-handler %static -new-server ":8083" +http-server ":8083" |handle "/static/" strip-prefix sh "/static/" |handle "/" fn { w r } { .write to-string now } |serve diff --git a/examples/webserver/upload.rye b/examples/webserver/upload.rye index d2cc8b39..5e066197 100644 --- a/examples/webserver/upload.rye +++ b/examples/webserver/upload.rye @@ -23,7 +23,7 @@ upload: fn { w r } { write w "OK" } -new-server ":8080" +http-server ":8080" |handle "/" new-static-handler %www |handle "/upload" ?upload |serve diff --git a/examples/webserver/websocket.rye b/examples/webserver/websocket.rye index ee96f3c8..bd6fb07e 100644 --- a/examples/webserver/websocket.rye +++ b/examples/webserver/websocket.rye @@ -3,7 +3,7 @@ rye .needs { http } -new-server ":9090" +http-server ":9090" |handle-ws "/echo" fn { s ctx } { forever { read s |write* s } } |handle-ws "/captcha" fn { s ctx } { write s "Hasta la vista,"