Skip to content

Commit

Permalink
adding docs and fixing a 3 years old typo
Browse files Browse the repository at this point in the history
  • Loading branch information
adonese committed Apr 26, 2020
1 parent 89e6003 commit 5047b95
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ COPY --from=builder /install /usr/local
COPY . /app
WORKDIR /app

CMD ["gunicorn", "--bind 127.0.0.1:8082","-w 3", "app:app"]
CMD ["gunicorn", "--bind=127.0.0.1:8082","-w 3", "app:app"]
EXPOSE 8082
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# iStole

You are being watched.


# API Part

Method: POST
mimetype: json
Endpoint: /

Request fields:

["short_description", "long_description", "lat", "long"]

short_description:

a brief description of the problem (mandatory)

long description:

A long desciption of the problem / issue. Optional

lat:

GPS latitude coordinates

long:

GPS longitude coordinates
6 changes: 3 additions & 3 deletions helper.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
def json_handler(data: dict, q, db) -> list:
required_data = ["short_describtion", "long_describtion", "lat", "long"]
required_data = ["short_describtion", "lat", "long", "short_description"]
if not check_required(required_data, data):
return [400, {"error": "missing_field"}]
q.lat = data["lat"]
q.long = data["long"]
q.short_describtion = data["short_describtion"]
q.long_describtion = data["long_describtion"]
q.short_describtion = data["short_describtion"] or data["short_description"]
q.long_describtion = data["long_describtion"] or data["long_description"]
db.session.add(q)
db.session.commit()
return [200, {"response": "ok"}]
Expand Down
13 changes: 0 additions & 13 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ <h1 id="about">About this application</a></h1>
</p>
</div>

<button>Start streaming</button>
<video autoplay>Start streaming</button>



<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
Expand Down Expand Up @@ -190,14 +185,6 @@ <h1 id="about">About this application</a></h1>
}
</script>

<script>
document.querySelector('button').addEventListener('click', async (e) => {
const stream = await navigator.mediaDevices.getUserMedia({
video: true
})
document.querySelector('video').srcObject = stream
})
</script>
</body>

</html>

0 comments on commit 5047b95

Please sign in to comment.