@maxpeterkaya/web-proxy 1.0.0 → 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.0",
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"
package/.idea/discord.xml DELETED
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="DiscordProjectSettings">
4
- <option name="show" value="ASK" />
5
- <option name="description" value="" />
6
- </component>
7
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="JavaScriptLibraryMappings">
4
- <includedPredefinedLibrary name="Node.js Core" />
5
- </component>
6
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/web-proxy.iml" filepath="$PROJECT_DIR$/.idea/web-proxy.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="Go" enabled="true" />
4
- <component name="NewModuleRootManager">
5
- <content url="file://$MODULE_DIR$" />
6
- <orderEntry type="inheritedJdk" />
7
- <orderEntry type="sourceFolder" forTests="false" />
8
- </component>
9
- </module>
package/bin/web-proxy DELETED
Binary file
package/go.mod DELETED
@@ -1,22 +0,0 @@
1
- module web-proxy
2
-
3
- go 1.24
4
-
5
- require (
6
- github.com/joho/godotenv v1.5.1
7
- github.com/labstack/echo/v4 v4.13.4
8
- github.com/rs/zerolog v1.34.0
9
- )
10
-
11
- require (
12
- github.com/labstack/gommon v0.4.2 // indirect
13
- github.com/mattn/go-colorable v0.1.14 // indirect
14
- github.com/mattn/go-isatty v0.0.20 // indirect
15
- github.com/valyala/bytebufferpool v1.0.0 // indirect
16
- github.com/valyala/fasttemplate v1.2.2 // indirect
17
- golang.org/x/crypto v0.38.0 // indirect
18
- golang.org/x/net v0.40.0 // indirect
19
- golang.org/x/sys v0.33.0 // indirect
20
- golang.org/x/text v0.25.0 // indirect
21
- golang.org/x/time v0.11.0 // indirect
22
- )
package/go.sum DELETED
@@ -1,44 +0,0 @@
1
- github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
2
- github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
3
- github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4
- github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
5
- github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
6
- github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
7
- github.com/labstack/echo/v4 v4.13.4 h1:oTZZW+T3s9gAu5L8vmzihV7/lkXGZuITzTQkTEhcXEA=
8
- github.com/labstack/echo/v4 v4.13.4/go.mod h1:g63b33BZ5vZzcIUF8AtRH40DrTlXnx4UMC8rBdndmjQ=
9
- github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
10
- github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
11
- github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
12
- github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
13
- github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
14
- github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
15
- github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
16
- github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
17
- github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
18
- github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
19
- github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
20
- github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
21
- github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
22
- github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
23
- github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
24
- github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
25
- github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
26
- github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
27
- github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
28
- github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
29
- github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
30
- golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
31
- golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
32
- golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
33
- golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
34
- golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
35
- golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
36
- golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
37
- golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
38
- golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
39
- golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
40
- golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
41
- golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0=
42
- golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
43
- gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
44
- gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=