Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add improvements to the http server #65

Merged
merged 11 commits into from
Sep 20, 2024
Merged

Conversation

danvergara
Copy link
Owner

@danvergara danvergara commented Sep 11, 2024

Add quality of life changes

Description

This PR addresses some issues by adding some quality of life changes to morphos.

  1. Add graceful shutdown to the http server
  2. Add a healtz endpoint for health checks
  3. Add a health check to the compose file
  4. Rename the temporary path environment variable to MORPHOS_UPLOAD_PATH
  5. Fixes the zip file preview by adding just an icon of a zip file
  6. Add non-root user to the Dockerfile
  7. Add a fix to shorten the modal title
  8. Add an API to integrate morphos with other services, not only hypermedia

Screenshot from 2024-09-19 22-07-49

API:

GET /api/v1/formats

Response:

{"documents": ["docx", "xls"], "image": ["png", "jpeg"]}

POST /api/v1/upload/

Thi the endpoint converts files to a desired format. It is basically a multipart form data in a POST request. The API simply writes the converted files to the response body.

Usage:

curl -F 'targetFormat=epub' -F 'uploadFile=@/path/to/file/foo.pdf' localhost:8080/api/v1/upload --output foo.epub

Fixes #64
Fixes #59
Fixes #61
Fixes #50

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Chore
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

I QA'd every change done in this PR

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

@danvergara danvergara self-assigned this Sep 11, 2024
@danvergara danvergara added the enhancement New feature or request label Sep 11, 2024
@danvergara danvergara marked this pull request as ready for review September 13, 2024 05:56
@danvergara danvergara force-pushed the server-improvements-healthcheck branch from 3cb87e5 to b70ee7f Compare September 13, 2024 06:35
@danvergara danvergara force-pushed the server-improvements-healthcheck branch from 4a25cd3 to c42f4bd Compare September 17, 2024 14:35
@danvergara danvergara merged commit 86123de into main Sep 20, 2024
1 check passed
@danvergara danvergara deleted the server-improvements-healthcheck branch September 20, 2024 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants