Permalink
Browse files

First attempt a working concept for WASP.

Application and Server abstract classes layed out. A simple hello example created.
Nothing works yet, but its a start.
  • Loading branch information...
0 parents commit 0a5ce31e62658062baae7c109349cf6a2d54c1be @joshthecoder committed Feb 2, 2010
Showing with 90 additions and 0 deletions.
  1. +19 −0 LICENSE
  2. +14 −0 README
  3. +22 −0 examples/hello.ooc
  4. +6 −0 wasp.use
  5. +18 −0 wasp/Application.ooc
  6. +11 −0 wasp/Server.ooc
19 LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Joshua Roesslein
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
14 README
@@ -0,0 +1,14 @@
+ooc-web
+========
+This is a working concept for a Web Application and Server Protocol(WASP).
+WASP will provide a common interface for web applications to any web server
+that implements the protocol. This concept is very similiar to what Python's WSGI provides.
+
+Author: Joshua Roesslein
+License:
+ WASP library: BSD
+ Specification: Public Domain
+
+References:
+ OOC: http://ooc-lang.org
+ WSGI: http://www.python.org/dev/peps/pep-0333/
@@ -0,0 +1,22 @@
+use wasp
+use fastcgi
+
+import wasp/Application
+import fastcgi/FCGIServer
+
+
+HelloApplication: class extends Application {
+ sendResponse: func(response: ResponseWriter) {
+ response write("Hello world from ooc!")
+ return true
+ }
+}
+
+main: func {
+ helloApp := HelloApp new()
+ server := FCGIServer new(":8000")
+
+ server install("/", helloApp)
+ server start()
+}
+
@@ -0,0 +1,6 @@
+Name: WASP
+Version: 1.0
+Origin: git://github.com/joshthecoder/ooc-web.git
+Description: Web Application and Server Specification
+Requires: FastCGI
+SourcePath: .
@@ -0,0 +1,18 @@
+use wasp
+
+import structs/HashMap
+
+Request: abstract class {
+}
+
+ResponseWriter: abstract class {
+ write: func(data: String) -> Int
+ flush: func
+}
+
+Application: abstract class {
+ parseRequest: func(request: Request) -> Bool
+ sendHeaders: func(headers: HashMap<String>) -> Bool
+ sendResponse: func(writer: ResponseWriter) -> Bool
+}
+
@@ -0,0 +1,11 @@
+use wasp
+import wasp/Application
+
+Server: abstract class {
+ start: func -> Bool
+ stop: func -> Bool
+
+ install: func(path: String, app: Application) -> Int
+ remove: func(path: String, position: Int) -> Application
+ removeAll: func(path: String)
+}

0 comments on commit 0a5ce31

Please sign in to comment.