Sign inSign up

brewery/export-service

By brewery

Updated about 4 years ago

It is a service created for Export processes. The project was written with Nest Framework.

Image
0

1.7K

brewery/export-service repository overview

Nest Logo

EXPORT SERVICE

Description

It is a service created for Export processes. The project was written with Nest Framework.

Instructions

Docker Compose

By creating the docker-compose.yml file, it is possible to deploy the project with docker commands below. You can visit the Docker Hub Repository to review the versions.

version: "3"
services:
  serve:
    container_name: export-service
    image: brewery/export-service:latest
    expose:
      - ${PORT}
    restart: always
    ports:
      - "${PORT}:${PORT}"
    env_file:
      - .env
$ docker-compose up -d

Environment Variables

Variable NameDescriptionRequiredDefault
ENVIRONMENTSpecifies the environment name. If the environment name is given as dev, Swagger operates actively.NOdev
CORSWebsite endpoints can be defined for Cors safety.NO*
PORTIt is determined which port will be deploy.NO3000
GLOBAL_PREFIXAllows to add additional pathname to the service end.NO-
BODY_SIZE_LIMITSpecifies the maximum size of the data that will come from the body during the request.NO5mb
API_KEYIt allows to add an api key control to the service for security during service use.NO-

Request Examples

HTML to PDF

The parameters that can be sent in the body are in the table below.

KeyDescriptionRequiredTypeDefult
fileNameCreated PDF file represents its name.YESstring-
typeDetermines the type of transformation of the incoming data.YESenum(Html, Url)-
htmlHTML string to be converted to PDF is sent in format.NOstring-
urlThe HTML response that comes with the request for GET is converted to PDF.NOstring-
formatSpecifies the PDF page size.YESenum(Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6)-
responseTypeSpecifies the type that the service will return.YESenum(Stream, Base64)-

REQ

// POST {{ENDPOINT}}/{{GLOBAL_PREFIX}}/html-to-pdf
{
    "url": "https://google.com.tr",
    "type": "url",
    "fileName": "hello-word",
    "format": "a3",
    "responseType": "stream"
}
// POST {{ENDPOINT}}/{{GLOBAL_PREFIX}}/html-to-pdf
{
    "html": "<h1>Hello Word</h1>",
    "type": "html",
    "fileName": "hello-word",
    "format": "a2",
    "responseType": "stream"
}

License

Export Service is MIT licensed.

Tag summary

Content type

Image

Digest

sha256:e8be2e0ce

Size

356 MB

Last updated

about 4 years ago

docker pull brewery/export-service