@maxpeterkaya/web-proxy 1.0.1 → 1.0.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.
package/INSTALL-GUIDE.md CHANGED
@@ -1,8 +1,43 @@
1
1
  # How to install web-proxy
2
2
 
3
- ## Container Middleware
3
+ ## NPM Package
4
+
5
+ You can install web-proxy as a wrapper in the form of a npm package! This allows you to dynamically download the latest
6
+ version of web-proxy at all times in your build stage without having to tweak your process to manually fetch the latest
7
+ version through commands.
4
8
 
5
9
  ### Step 1
6
- In your Dockerfile
7
10
 
8
- ## Docker Network Routing
11
+ Install: ``npm i @maxpeterkaya/web-proxy concurrently``
12
+
13
+ While running ``npm i``, it will automatically download the latest binary with execution permissions.
14
+
15
+ Currently you need to run your app and web-proxy through concurrently to ensure both are running concurrently.
16
+
17
+ ### Step 2
18
+
19
+ Add the following scripts to your package.json:
20
+
21
+ ```json
22
+ {
23
+ "scripts": {
24
+ "start:proxy": "./node_modules/.bin/web-proxy",
25
+ "start:web": "YOUR COMMAND TO START YOUR APP",
26
+ "start": "concurrently --prefix none \"npm run start:web\" \"npm run start:proxy\""
27
+ }
28
+ }
29
+ ```
30
+
31
+ You can view the docs for concurrently [here](https://github.com/open-cli-tools/concurrently/tree/main/docs).
32
+
33
+ #
34
+
35
+ In the future web-proxy will be able to start your web app itself without the use of concurrently.
36
+
37
+ ### Step 3
38
+
39
+ Simply just run ``npm run start`` and enjoy structured logs.
40
+
41
+ ## Container Middleware
42
+
43
+ Follow the steps [here](https://github.com/maxpeterkaya/web-proxy/tree/main/examples/container-middleware).
package/install.js CHANGED
@@ -35,7 +35,7 @@ const destFile = path.join(destDir, `${platform === "win32" ? "web-proxy.exe" :
35
35
  const res = await fetch(url);
36
36
  if (!res.ok) throw new Error(`Failed to fetch ${url}: ${res.statusText}`);
37
37
 
38
- const fileStream = fs.createWriteStream(destFile);
38
+ const fileStream = fs.createWriteStream(destFile, {mode: 0o755});
39
39
  await finished(Readable.fromWeb(res.body).pipe(fileStream));
40
40
 
41
41
  console.info('web-proxy installed.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxpeterkaya/web-proxy",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Server middleware enabling better logging for web apps through structured logs",
5
5
  "bin": {
6
6
  "web-proxy": "bin/run.js"