Skip to content

Commit

Permalink
First attempt a working concept for WASP.
Browse files Browse the repository at this point in the history
Application and Server abstract classes layed out. A simple hello example created.
Nothing works yet, but its a start.
  • Loading branch information
joshthecoder committed Feb 2, 2010
0 parents commit 0a5ce31
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 0 deletions.
19 changes: 19 additions & 0 deletions 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 changes: 14 additions & 0 deletions 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/
22 changes: 22 additions & 0 deletions examples/hello.ooc
@@ -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()
}

6 changes: 6 additions & 0 deletions wasp.use
@@ -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: .
18 changes: 18 additions & 0 deletions wasp/Application.ooc
@@ -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
}

11 changes: 11 additions & 0 deletions wasp/Server.ooc
@@ -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.