Stub Archive Module

Change-Id: I65fe0479b0a5e95c1439823eec0c96dbefb46716
diff --git a/Makefile b/Makefile
index 5f3cb4f..c52265f 100644
--- a/Makefile
+++ b/Makefile
@@ -179,7 +179,8 @@
 # start a local instance. defaults to port 8080 for the app and 8000
 # for the appengine console
 localserver:
-	thirdparty/google_appengine/dev_appserver.py build
+	thirdparty/google_appengine/dev_appserver.py \
+		build/app.yaml build/dispatch.yaml archive/archive.yaml
 
 # return to a pristine git checkout.  *DELETES EVERYTHING WITHOUT PROMPTING*
 gitclean:
@@ -230,11 +231,12 @@
 	bin/gen-app-yaml -f $(APP)
 
 # TODO(robert): set the default value of APP to local-devel?
+# Does not push dispatch.yaml or the archive
 push-release-to-appengine:
 	thirdparty/google_appengine/appcfg.py \
 		--application=$(APP) \
 		--noauth_local_webserver \
-		--oauth2 update build
+		--oauth2 update build/app.yaml
 
 do-dev-release: APP=YOU_MUST_SPECIFY_A_VALID_APP
 do-dev-release: generated update-dev-version push-release-to-appengine
diff --git a/app/dispatch.yaml b/app/dispatch.yaml
new file mode 100644
index 0000000..5db2fa7
--- /dev/null
+++ b/app/dispatch.yaml
@@ -0,0 +1,12 @@
+# Route all archive related paths to the archive module.  Anything not
+# explicitly mentioned stays in the default module.
+#
+# Deployment Instructions:
+# thirdparty/google_appengine/appcfg.py --oauth2 -A melange-staging \
+#    update_dispatch build
+
+dispatch:
+- url: "*/archive"
+  module: archive
+- url: "*/archive/*"
+  module: archive
diff --git a/archive/archive.yaml b/archive/archive.yaml
new file mode 100644
index 0000000..e686789
--- /dev/null
+++ b/archive/archive.yaml
@@ -0,0 +1,31 @@
+# archive.yaml is the configuration for the 'archive' module.
+#
+# It lives in it's own directory so that deploying it is simple and so it
+# doesn't try and deploy all of the rest of Melange too.
+#
+# Deployment Instructions:
+# thirdparty/google_appengine/appcfg.py --oauth2 -A <PROJECT_ID> \
+#    update archive/archive.yaml
+#
+# Note:
+# zipserve does not support directory indexes or auto adding of /.  When
+# testing, you need  to go to /archive/index.html directly.
+#
+
+application: local-devel
+version: 0-stub
+module: archive
+threadsafe: no
+
+runtime: python27
+api_version: 1
+
+handlers:
+- url: /archive/?$
+  script: $PYTHON_LIB/google/appengine/ext/zipserve
+- url: /archive/.*
+  script: $PYTHON_LIB/google/appengine/ext/zipserve
+
+# Generate archive.zip (if necessary) with:
+# echo 'Stub Melange Archive' > /tmp/index.html
+# zip -0 --junk-paths archive.zip /tmp/index.html
diff --git a/archive/archive.zip b/archive/archive.zip
new file mode 100644
index 0000000..507c624
--- /dev/null
+++ b/archive/archive.zip
Binary files differ
diff --git a/pavement.py b/pavement.py
index 1ff6c79..2db91af 100644
--- a/pavement.py
+++ b/pavement.py
@@ -43,6 +43,7 @@
 DONT_COPY_DIRS = []  # subset of COPY_DIRS to exclude
 APP_FILES = [
     'app.yaml',
+    'dispatch.yaml',
     'index.yaml',
     'queue.yaml',
     'cron.yaml',