cherfia / chromiumly

A lightweight Typescript library that interacts with Gotenberg's different modules to convert a variety of document formats to PDF files.
MIT License
54 stars 7 forks source link

Different .env variable name for GROTEBENRB_ENDPOINT #410

Open forg002-ctrl opened 1 week ago

forg002-ctrl commented 1 week ago

Hi, I'd like to have another name for GROTENBERG_EDPOINT variable. Long story short, I have three .env variables: image

I configure them in my main.ts file: image

I've configured HtmlConverter as provider for getting it through DI: image

I get in from DI in the service, where I need to use it: image

I get the error: image

cherfia commented 1 week ago

@forg002-ctrl If you're using dotenv already, you don't actually need to use Chromiumly.configure(). Instead, you can simply set up the environment variables as shown here. Or is GROTENBERG_BASE_URL used elsewhere in your code where it's not related tochromiumly?

cherfia commented 1 week ago

@forg002-ctrl I plan to drop support for config and dotenv in version 4.0.0. Configuration will be done through Chromiumly.configure(), allowing users to name their environment variables as they wish 😄 Migration will be simple; users just need to add this method to their code. What do you think? 🤔

forg002-ctrl commented 1 week ago

@forg002-ctrl I plan to drop support for config and dotenv in version 4.0.0. Configuration will be done through Chromiumly.configure(), allowing users to name their environment variables as they wish 😄 Migration will be simple; users just need to add this method to their code. What do you think? 🤔

Hi, I think it's the best way to configure the env variables.

cherfia commented 1 week ago

@forg002-ctrl If you're using dotenv already, you don't actually need to use Chromiumly.configure(). Instead, you can simply set up the environment variables as shown here. Or is GROTENBERG_BASE_URL used elsewhere in your code where it's not related tochromiumly?

@forg002-ctrl how about this?