Skip to content

Commit ded4fe1

Browse files
committed
Added setter and getter to Server for installing Applications.
1 parent 46ca7f8 commit ded4fe1

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

examples/hello.ooc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ HelloApplication: class extends Application {
1919

2020
main: func {
2121
server := FCGIServer new(":8000")
22-
server application = HelloApplication new()
22+
server setApplication(HelloApplication new())
23+
2324
server run()
2425
}
2526

examples/sendfile.ooc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ SendFile: class extends Application {
1717

1818
main: func {
1919
server := FCGIServer new(":8000")
20-
server application = SendFile new()
20+
server setApplication(SendFile new())
2121
server run()
2222
}

web/Server.ooc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ use web
22
import web/Application
33

44
Server: abstract class {
5-
run: func -> Bool { return false }
65
application: Application
6+
7+
setApplication: func(=application) {}
8+
application: func -> Application { application }
9+
10+
run: func -> Bool { return false }
711
}

0 commit comments

Comments
 (0)