eg: add appengine skeleton
This commit is contained in:
parent
b4ff53e5f8
commit
e1b3f2cf74
1
eg/appengine/.gitignore
vendored
Normal file
1
eg/appengine/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
env
|
23
eg/appengine/README.md
Normal file
23
eg/appengine/README.md
Normal 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
13
eg/appengine/app.yaml
Normal 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
|
3
eg/appengine/appengine_config.py
Normal file
3
eg/appengine/appengine_config.py
Normal 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
7
eg/appengine/main.hy
Normal 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
2
eg/appengine/main.py
Normal file
@ -0,0 +1,2 @@
|
||||
from hy.importer import import_file_to_module
|
||||
__hymain__ = import_file_to_module('__hymain__', 'main.hy')
|
2
eg/appengine/requirements.txt
Normal file
2
eg/appengine/requirements.txt
Normal file
@ -0,0 +1,2 @@
|
||||
Flask
|
||||
hy==0.9.10 # master is broken because of rply
|
Loading…
Reference in New Issue
Block a user