diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2022-05-21 22:38:52 +0100 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2022-05-21 22:38:52 +0100 |
commit | f2f734194c03dfff2024cf417c502515ddb7a855 (patch) | |
tree | 745910a6206be1243187523bef355849dda0da77 /docs/source/api.rst | |
parent | abc7f067ff20bc2bd07d9236c30055549481547c (diff) | |
download | Smarker-f2f734194c03dfff2024cf417c502515ddb7a855.tar.gz Smarker-f2f734194c03dfff2024cf417c502515ddb7a855.zip |
Added running as an API
Diffstat (limited to 'docs/source/api.rst')
-rw-r--r-- | docs/source/api.rst | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/source/api.rst b/docs/source/api.rst new file mode 100644 index 0000000..61469f9 --- /dev/null +++ b/docs/source/api.rst @@ -0,0 +1,26 @@ +.. _api: + +Running as an API +================= + +*Smarker* can be hosted on a server and accessed through an API. A valid docker-compose +file is in the ``API/`` directory. Since the API docker container accesses the host docker +daemon, you must pass set the host location of the ``.uploads/`` directory as the ``$UPLOADS_DIR`` +environment variable. + +.. autofunction:: app.helloworld + +.. autofunction:: app.mark + +An example CURL request could be: + +.. code-block:: bash + + curl -X POST -H "Content-Type: multipart/form-data" \ + -F "zip=@../100301654.zip" \ + -F "key=2g_yU7n1SqTODGQmpuViIAwbdbownmVDpjUl9NKkRqz" \ + -F "assessment=example" \ + -F "filedep1=@../../dependency.txt" \ + -F "dependency.txt=/dependency.txt" \ + "localhost:6970/api/mark" + |