Skip to content

Commit e3d5b9b

Browse files
committed
Tweaks
1 parent 39996f9 commit e3d5b9b

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ If you use Docker Compose (hopefully with [`kool`](https://github.com/kool-dev/k
1111
```yml
1212
pdf:
1313
image: "kooldev/pdf:1.0"
14-
expose:
15-
- 3000
14+
ports:
15+
- "3000:3000"
1616
```
1717
1818
- After starting the service containers (with either `kool start` or `docker-compose up -d`), you can already start using the microservice to make PDFs! Example using PHP:
1919

2020
```php
2121
use GuzzleHttp\Client;
2222
23-
$pdf = (new Client())->post('http://pdf_dev/from-html', [
23+
// the hostname is the docker-compose service name, or an alias you add to your docker network
24+
$pdf = (new Client())->post('http://pdf:3000/from-html', [
2425
'form_params' => [
2526
'html' => '<h1>This is my super kool HTML that I want to turn into an awesome PDF file!</h1> <p> This is a very silly example, but you get the idea of how powerful this is <b>:)</b> </p>',
2627
'options' => json_encode([

kool.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ scripts:
22
yarn: kool docker node:14-alpine yarn
33

44
build:
5-
- docker build --no-cache -t kooldev/pdf:latest -f Dockerfile.dist .
5+
- docker build --no-cache -t kooldev/pdf:latest .

pdf-service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function generateFileName() {
155155
}
156156

157157
function log(message) {
158-
let date = (new Date).toLocaleString();
158+
let date = new Date().toISOString().replace('T', ' ').substr(0, 19)
159159

160160
console.log(`[${date}] ${message}`);
161161
}

0 commit comments

Comments
 (0)