<%- '<!DOCTYPE html>' %>
<html lang="en">
  <head>
    <title>API</title>
    <link rel="stylesheet" href="/static/api.css">
    <%- include('partials/metadata') %>
  </head>
  <body>
    <div id="app">
      <p id="title">API</p>
      <a draggable="false" href="/" rel="noreferrer">Home</a><br><br><br>
      <p id="info">Base URL: <code class="inline">https://kim.kieranhowland.cc/api/(endpoint)</code></p>
      <p id="info">Uploads Base URL: <code class="inline">https://kim.kieranhowland.cc/uploads/(id)</code></p><br>
      <table>
        <tr>
          <th>Method</th>
          <th>Endpoint</th>
          <th>Response</th>
          <th>Description</th>
        </tr>
        <tr>
          <td>POST</td>
          <td>/upload/</td>
          <td>
            <p>Request:</p>
            <code>curl -X POST -F 'image=@image.jpg' https://kim.kieranhowland.cc/api/upload/</code><br>
            <p>Response:</p>
            <code>{
  "status": 200,
  "data": {
    "id": "bqzy5hrk0yfmmqt",
    "type": {
      "ext": "jpg",
      "mime": "image/jpeg"
    }
  }
}</code>
          </td>
          <td>Uploads image and returns the ID of the uploaded image along with the file type.</td>
        </tr>
        <tr>
          <td>GET</td>
          <td>/meta/(ID)/</td>
          <td>
            <p>Request:</p>
            <code>curl https://kim.kieranhowland.cc/api/meta/bqzy5hrk0yfmmqt/</code><br>
            <p>Response:</p>
            <code>{
  "status": 200,
  "data": {
    "uploaded": 1569365756657,
    "type": {
      "ext": "jpg",
      "mime": "image/jpeg"
    }
  }
}</code>
          </td>
          <td>Returns the meta data associated with the request image.</td>
        </tr>
        <tr>
          <td>GET</td>
          <td>/delete/(ID)/</td>
          <td>
            <p>Request:</p>
            <code>curl https://kim.kieranhowland.cc/api/delete/bqzy5hrk0yfmmqt/</code><br>
            <p>Response:</p>
            <code>{
  "status": 200,
  "data": "success"
}</code>
          </td>
          <td>Deletes the specified image if the senders IP address matches the one stored.</td>
        </tr>
      </table>
    </div>
  </body>
</html>
<script>/**/</script>
<%- include('partials/generated') %>