title: hug create GET endpoint to download created word document
body: <p>I'm working with Python <a href="https://www.hug.rest/" rel="nofollow noreferrer">hug API</a> would like to create a <code>GET</code> API for the frontend. The frontend can download a created word document file e.g. via download button. However, after going through a <a href="https://hugapi.github.io/hug/reference/hug/output_format/" rel="nofollow noreferrer">documentation</a>, I still cannot figure out a way to do it.</p>
  
  <p>Here is my working script so far:</p>
  
  <pre><code>import os
  import hug
  from docx import Document
  
  @hug.get("/download_submission_document")
  def download_submission_document():
      file_name = 'example.docx'
      document = Document()
      document.add_heading('Test header', level=2)
      document.add_paragraph('Test paragraph')
      document.save(file_name)
      # TO DO: send a created file to frontend
  </code></pre>
  
  <p>I'm not sure if we can send the object right away or we have to save it first somewhere before sending the the frontend. (requirements: <code>hug</code>, <code>python-docx</code>)</p>
  
  <p>I'm trying to use something like</p>
  
  <pre><code>@hug.get("/download_submission_document", output=hug.output_format.file)
  </code></pre>
  
  <p>but not sure how to return a file.</p>