Skip to content

Commit ee4649e

Browse files
committed
First commit
0 parents  commit ee4649e

File tree

9 files changed

+396
-0
lines changed

9 files changed

+396
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.env
2+
*.pyc

Pipfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[[source]]
2+
3+
url = "https://pypi.python.org/simple"
4+
verify_ssl = true
5+
name = "pypi"
6+
7+
8+
[dev-packages]
9+
10+
sseclient = "*"
11+
ipython = "*"
12+
13+
14+
[packages]
15+
16+
flask = "*"
17+
requests = "*"

Pipfile.lock

Lines changed: 286 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# smee.py
2+
3+
A [smee](https://smee.io/) client example written in Python.
4+
5+
## Installation
6+
7+
Install dependencies:
8+
9+
```
10+
pipenv install
11+
```
12+
13+
Generate a `.env` from the included `env.example` and update the values to reflect your environment.
14+
15+
## Usage
16+
17+
```
18+
./script/server
19+
```

app/app.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import flask
2+
3+
from flask import request
4+
5+
6+
app = flask.Flask(__name__)
7+
8+
9+
@app.route('/', methods=['GET', 'POST'])
10+
def hello():
11+
print request.get_json()
12+
return "Hello {}!".format("world")

env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FLASK_APP=app/app.py
2+
WEBHOOK_PROXY_URL=https://smee.io/XXXXXXXXXXXXXXX

script/server

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash -i
2+
3+
set -e
4+
5+
cd "$( dirname "$0" )/.."
6+
7+
# Start smee client in background
8+
pipenv run python ./smee.py &
9+
10+
# Kill background task (smee, above) on SIGINT
11+
# https://unix.stackexchange.com/a/204619
12+
trap 'kill -s INT %1' SIGINT
13+
14+
# Start flask app
15+
pipenv run flask run

script/shell

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
cd "$( dirname "$0" )/.."
6+
7+
# Start ipython via pipenv
8+
pipenv run ipython

0 commit comments

Comments
 (0)