diff --git a/src/templates/mybase.html b/src/templates/mybase.html index f4fddae..41a31e6 100644 --- a/src/templates/mybase.html +++ b/src/templates/mybase.html @@ -28,6 +28,7 @@ diff --git a/src/templates/upload.html b/src/templates/upload.html new file mode 100644 index 0000000..837e527 --- /dev/null +++ b/src/templates/upload.html @@ -0,0 +1,12 @@ +{% extends "mybase.html" %} +{% block title %}FOTB - Uploading{% endblock %} + +{% block main %} +{{ super() }} +
+

Uploading Data

+

Uploading data is simple, all you need to is send a POST request with content-type application/json to this URL.

+

Your JSON must respect all the required fields.

+

Example: curl -H "Content-Type: application/json" -X POST -d '{"gpu":"GPU DUMMY TEXT","cpu":"CPU DUMMY TEXT","log":"So this will be a detailed log.","score": 1}' http://localhost:5000/upload

+
+{% endblock %} \ No newline at end of file diff --git a/src/views/scoreboard.py b/src/views/scoreboard.py index 1147b87..0fa724e 100644 --- a/src/views/scoreboard.py +++ b/src/views/scoreboard.py @@ -34,7 +34,7 @@ def upload(): an error string. """ if flask.request.method == 'GET': - flask.abort(404) + return flask.render_template('upload.html') content = flask.request.get_json() diff --git a/test/test_scoreboard.py b/test/test_scoreboard.py index f47b32c..443a5ff 100644 --- a/test/test_scoreboard.py +++ b/test/test_scoreboard.py @@ -68,4 +68,4 @@ class ScoreboardTestCase(unittest.TestCase): def test_get_upload(self): response = self.client.get('/upload') - self.assertEqual(response.status_code, 404) + self.assertEqual(response.status_code, 200)