@@ -19,11 +19,12 @@ Server created for javascript SPA apps like: Vue, React, Angular, etc.
1919* Corporate config standard supported by default and injected too.
2020* Brotli-compression. Compression based on ` Accept-Encoding ` header. [ More] ( #Compression ) .
2121* Deny all ` robots.txt ` by default.
22+ * Hot reload
2223
2324## Docker usage
2425
2526``` Dockerfile
26- FROM microparts/static-server-php:1.1.4
27+ FROM microparts/static-server-php:1.2.0
2728
2829COPY dist/ /app
2930# frontend yaml configuration
@@ -43,22 +44,43 @@ CLI usage implies 2 commands for usage:
4344
44451 ) Start server:
4546``` bash
46- bin/static- server run
47+ server run
4748```
4849
4950Result:
5051``` bash
51- [2019-06-19 08:54:52] Server.INFO: CONFIG_PATH = /app/configuration
52- [2019-06-19 08:54:52] Server.INFO: STAGE = dev
53- [2019-06-19 08:54:52] Server.INFO: Configuration loaded.
54- [2019-06-19 08:54:52] Server.INFO: Application state is: STAGE=dev SHA1=55b5293
55- [2019-06-19 08:54:52] Server.INFO: HTTP static server started at 0.0.0.0:8080
52+ [2019-08-07 18:05:17] Server.INFO: State: STAGE=dev SHA1=55b5293 WORKERS=16 PID=10768 CONFIG_PATH=/app/configuration
53+ [2019-08-07 18:05:17] Server.INFO: Server started at 0.0.0.0:8080
5654```
5755
56+ 2 ) Reload
5857
59- 2 ) Dump loaded configuration:
58+ After editing files or configuration you can reload server without restart master process.
59+
60+ ``` bash
61+ server reload
62+ ```
63+
64+ Reload command result:
65+ ``` bash
66+ [2019-08-07 18:07:00] Reload.INFO: CONFIG_PATH = /app/configuration
67+ [2019-08-07 18:07:00] Reload.INFO: STAGE = dev
68+ [2019-08-07 18:07:00] Reload.INFO: Configuration loaded.
69+
70+ Server reloaded
71+ ```
72+
73+ Server result:
74+ ``` bash
75+ [2019-08-07 18:05:17] Server.INFO: State: STAGE=dev SHA1=55b5293 WORKERS=16 PID=10768 CONFIG_PATH=/app/configuration
76+ [2019-08-07 18:05:17] Server.INFO: Server started at 0.0.0.0:8080
77+ [2019-08-07 21:07:00 $1 0889.0] INFO Server is reloading all workers now
78+ ```
79+
80+
81+ 3 ) Dump loaded configuration:
6082``` bash
61- bin/static- server dump
83+ server dump
6284```
6385
6486Result:
@@ -105,6 +127,9 @@ server:
105127 worker_num: 4
106128 log_level: 0
107129 buffer_output_size: 33554432
130+ pid:
131+ location: /var/run/server.pid
132+ save: true
108133 mimes:
109134 map: application/json
110135 xml: application/xml
@@ -150,13 +175,13 @@ server:
150175 - autoplay ' none'
151176 referer_policy: no-referrer
152177 pragma: public
153- cache_control: public, must-revalidate, proxy-revalidate, max-age=31536000
178+ cache_control: public, must-revalidate, proxy-revalidate, max-age=604800
154179 frame_options: sameorigin
155180 xss_protection: 1; mode=block
156181 x_content_type: nosniff
157182 x_content_type_options: nosniff
158183 x_ua_compatible: IE=edge
159- sts: ' max-age=31536000 ; includeSubDomains; preload'
184+ sts: ' max-age=604800 ; includeSubDomains; preload'
160185```
161186
162187Comments about server configuration can be found [ here] ( ./configuration/defaults ) .
@@ -186,7 +211,7 @@ Also, will be injected `<link>` tag with `rel=preload`. [More](https://developer
186211By default will be added following headers to response:
187212``` http
188213Pragma: public
189- Cache-Control: public, must-revalidate, proxy-revalidate, max-age=31536000
214+ Cache-Control: public, must-revalidate, proxy-revalidate, max-age=604800
190215X-XSS-Protection: 1; mode=block
191216X-Frame-Options: SAMEORIGIN
192217X-Content-Type: nosniff
@@ -195,7 +220,7 @@ X-Ua-Compatible: IE=edge
195220Referrer-Policy: no-referrer
196221Feature-Policy: geolocation 'none'; payment 'none'; microphone 'none'; camera 'none'; autoplay 'none'
197222Content-Security-Policy: default-src 'self'; script-src 'self' cdnjs.cloudflare.com; img-src 'self' data:; style-src 'self' 'unsafe-inline' fonts.googleapis.com cdnjs.cloudflare.com; font-src 'self' data: fonts.gstatic.com cdnjs.cloudflare.com; form-action 'self'
198- Strict-Transport-Security: max-age=31536000 ; includeSubDomains; preload
223+ Strict-Transport-Security: max-age=604800 ; includeSubDomains; preload
199224```
200225
201226` A+ ` rating issued by the site https://securityheaders.com .
@@ -228,7 +253,7 @@ And it edit in accordance with business logic of application.
228253
229254### Link header
230255
231- As new feature since ` 1.1.4 ` version you able to use `Link` header
256+ As new feature since ` 1.2.0 ` version you able to use `Link` header
232257for server configuration.
233258
234259* How it use for `<link rel=preload>` requirements (lighthouse), – https://w3c.github.io/preload/#example-3 , https://w3c.github.io/preload/#example-6
0 commit comments