@tramvai/module-server 1.49.0 → 1.50.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +14 -7
  2. package/package.json +10 -10
package/README.md CHANGED
@@ -101,12 +101,12 @@ import { PROXY_CONFIG_TOKEN } from '@tramvai/tokens-server';
101
101
 
102
102
  The `ServerModule` has a built-in static server that allows you to distribute static files to users.
103
103
 
104
- To serve files, you need to create a directory `public` in the root of the project in which to place the necessary files.
105
- After that, all files will be available for request by browsers.
104
+ To serve files, you need to create a directory `public` in the root of the project in which to place the necessary files. After that, all files will be available for request by browsers.
106
105
 
107
106
  _For example, we want to distribute sw.js file from the project's root:_ for this we create a folder `public` in which we put the file `sw.js`. Now on the client side, we will be able to request data from the url http://localhost:3000/sw.js. Also, we will most likely need some modifications on the CI/CD side to copy the public folder to the stands.
108
107
 
109
108
  This function is also available in production. For this purpose, copy the folder `public` into the docker container
109
+
110
110
  ### PAPI
111
111
 
112
112
  Papi - API routes for the `tramvai` application. More information is available in [Papi](features/papi/introduction.md)
@@ -148,13 +148,11 @@ To enable such logging, simply add the `server:node-debug:request` key to the `L
148
148
 
149
149
  Metrics
150
150
 
151
- The metrics module is automatically connected into the server module.
152
- For more information on metrics, you can read [in the metrics documentation](references/modules/metrics.md)
151
+ The metrics module is automatically connected into the server module. For more information on metrics, you can read [in the metrics documentation](references/modules/metrics.md)
153
152
 
154
153
  ### Warming application caches
155
154
 
156
- The cache-warmup module is automatically plugged into the server module.
157
- Detailed information on cache warmup can be found [in cache-warmup documentation](references/modules/cache-warmup.md)
155
+ The cache-warmup module is automatically plugged into the server module. Detailed information on cache warmup can be found [in cache-warmup documentation](references/modules/cache-warmup.md)
158
156
 
159
157
  ### Custom headers
160
158
 
@@ -172,10 +170,19 @@ There are special headers in the module, which help to determine the exact infor
172
170
 
173
171
  For all of the headers above which are passed via environment variables to be available, you need the external infrastructure to pass them when building and deprovisioning the application image (inside tinkoff this is done automatically).
174
172
 
175
- ## Debugging
173
+ ### Debugging
176
174
 
177
175
  Module uses loggers with identifiers: `server`, `server:static`, `server:webapp`, `server:node-debug:request`
178
176
 
177
+ ## How to
178
+
179
+ ### Specify server port
180
+
181
+ By default server starts at `3000` port. You can change this value by specifying environment variable `PORT`:
182
+
183
+ - in dev environment it can be done by adding env `PORT` to file `env.development.json` e.g. `PORT: "8080"`
184
+ - it can be specified explicitly as an environment variable `PORT` e.g. `PORT=8080`
185
+
179
186
  ## Exportable tokens
180
187
 
181
188
  [Link](references/tokens/server-tokens.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-server",
3
- "version": "1.49.0",
3
+ "version": "1.50.2",
4
4
  "description": "",
5
5
  "browser": "lib/browser.js",
6
6
  "main": "lib/server.js",
@@ -23,10 +23,10 @@
23
23
  "@tinkoff/express-terminus": "0.1.12",
24
24
  "@tinkoff/monkeypatch": "1.3.3",
25
25
  "@tinkoff/url": "0.7.37",
26
- "@tramvai/module-cache-warmup": "1.49.0",
27
- "@tramvai/module-metrics": "1.49.0",
28
- "@tramvai/papi": "1.49.0",
29
- "@tramvai/tokens-server": "1.49.0",
26
+ "@tramvai/module-cache-warmup": "1.50.2",
27
+ "@tramvai/module-metrics": "1.50.2",
28
+ "@tramvai/papi": "1.50.2",
29
+ "@tramvai/tokens-server": "1.50.2",
30
30
  "body-parser": "^1.19.0",
31
31
  "compression": "^1.7.4",
32
32
  "cookie-parser": "^1.4.3",
@@ -36,11 +36,11 @@
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@tinkoff/utils": "^2.1.2",
39
- "@tramvai/cli": "1.49.0",
40
- "@tramvai/core": "1.49.0",
41
- "@tramvai/module-common": "1.49.0",
42
- "@tramvai/module-environment": "1.49.0",
43
- "@tramvai/tokens-common": "1.49.0",
39
+ "@tramvai/cli": "1.50.2",
40
+ "@tramvai/core": "1.50.2",
41
+ "@tramvai/module-common": "1.50.2",
42
+ "@tramvai/module-environment": "1.50.2",
43
+ "@tramvai/tokens-common": "1.50.2",
44
44
  "@tinkoff/dippy": "0.7.36",
45
45
  "tslib": "^2.0.3"
46
46
  },