✨
This commit is contained in:
32
Assignment-2/server.ol
Normal file
32
Assignment-2/server.ol
Normal file
@ -0,0 +1,32 @@
|
||||
|
||||
from .ServerInterface import ServerInterface
|
||||
from file import File
|
||||
|
||||
constants {
|
||||
FILENAME = "received.txt"
|
||||
}
|
||||
|
||||
|
||||
service ExampleServer {
|
||||
|
||||
embed File as file
|
||||
|
||||
inputPort server {
|
||||
Location: "socket://localhost:9000"
|
||||
Protocol: http
|
||||
Interfaces: ServerInterface
|
||||
}
|
||||
|
||||
|
||||
execution:concurrent
|
||||
|
||||
main {
|
||||
setFile( request )( response ) {
|
||||
writeFile@file( {
|
||||
filename = FILENAME
|
||||
content = request
|
||||
append = 1
|
||||
} )()
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user