eg: add appengine skeleton

This commit is contained in:
Johan Euphrosine 2013-10-31 11:56:48 -07:00
parent b4ff53e5f8
commit e1b3f2cf74
7 changed files with 51 additions and 0 deletions

1
eg/appengine/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
env

23
eg/appengine/README.md Normal file
View File

@ -0,0 +1,23 @@
App Engine skeleton for hylang
==============================
# Demo
[proppy-hy.appspot.com](https://proppy-hy.appspot.com)
[proppy-hy.appspot.com/paultag](https://proppy-hy.appspot.com/paultag)
# Setup
```
pip install -r requirements.txt -t env
```
# Run locally
```
dev_appserver.py .
```
# Deploy
```
appcfg.py -a ${APPID} --oauth2 update .
```

13
eg/appengine/app.yaml Normal file
View File

@ -0,0 +1,13 @@
application: hy-sample
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: main.__hymain__.app

View File

@ -0,0 +1,3 @@
import os.path
import sys
sys.path.insert(0, os.path.abspath('env'))

7
eg/appengine/main.hy Normal file
View File

@ -0,0 +1,7 @@
(require hy.contrib.meth)
(import [flask [Flask redirect]])
(def app (Flask __name__))
(route hello "/<name>" [name] (.format "(hello \"{0}!\")" name))
(route root "/" [] (redirect "/hyne"))

2
eg/appengine/main.py Normal file
View File

@ -0,0 +1,2 @@
from hy.importer import import_file_to_module
__hymain__ = import_file_to_module('__hymain__', 'main.hy')

View File

@ -0,0 +1,2 @@
Flask
hy==0.9.10 # master is broken because of rply