This microservice generates static websites with the data from books created with Ketty. It exposes the following endpoints:
POST /api/authPOST /previewPOST /publish
The /api/auth authenticates a client and returns an JWT accessToken with lifespan of 8h, which is used to communicate with the service. A valid call to this endpoint should containt the authorization header with value Basic base64encoded(clientId:clientSecret). Client id and secret should be created and registered beforehand.
The /preview endpoint will generate a temporary preview of the book, without recreating the images or storing any other assets associated with it. The previews are deleted every 24 hours.
The /publish endpoint will generate a standalone book, with images and other assets stored in the book folders, which can be shared via its unique URL. Published books can be found under: https://{{flax url}}/books/{{bookId}}
When the service is up by executing docker exec -it <name_of_the_pagedjs_server_container> yarn create:client.
The above will produce a valid pair of clientId and clientSecret
SECRET
POSTGRES_HOST
POSTGRES_DB
POSTGRES_USER
POSTGRES_PASSWORD
POSTGRES_PORT
POSTGRES_ALLOW_SELF_SIGNED_CERTIFICATES
CLIENT_ID
CLIENT_SECRET
NODE_ENV
The service is fully dockerized for ease of use for either development or for use in production.
In the root of the service run docker-compose -f docker-compose.production.yml up
This container contains just the service. An external Postgres DB should be provided.