Skip to content

Commit bb13f8d

Browse files
committed
A few updates to the API.
Multiple "routes" is now supported via an Application called Dispatcher. Server's now only have 1 installed application.
1 parent 3a00037 commit bb13f8d

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

examples/hello.ooc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import fastcgi/FCGIServer
66

77

88
HelloApplication: class extends Application {
9-
sendResponse: func(response: ResponseWriter) {
9+
sendResponse: func(response: ResponseWriter) -> Bool {
1010
response write("Hello world from ooc!")
1111
return true
1212
}
@@ -16,7 +16,7 @@ main: func {
1616
helloApp := HelloApp new()
1717
server := FCGIServer new(":8000")
1818

19-
server install("/", helloApp)
19+
server install(helloApp)
2020
server start()
2121
}
2222

wasp/Dispatcher.ooc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
use wasp
2+
import wasp/Application
3+
4+
Dispatcher: class extends Application {
5+
addRoute: func(route: String, app: Application) {
6+
//TODO: implement me
7+
}
8+
9+
removeRoute: func(route: String) {
10+
//TODO: implement me
11+
}
12+
}

wasp/Server.ooc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@ Server: abstract class {
55
start: func -> Bool
66
stop: func -> Bool
77

8-
install: func(path: String, app: Application) -> Int
9-
remove: func(path: String, position: Int) -> Application
10-
removeAll: func(path: String)
8+
application: Application
119
}

0 commit comments

Comments
 (0)