Skip to content

Commit

Permalink
init dummy-app
Browse files Browse the repository at this point in the history
  • Loading branch information
texano00 committed Jan 6, 2024
1 parent 9f8187a commit 4bb3f73
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dummy-app/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const server = http.createServer((req, res) => {
res.setHeader('Content-Type', 'text/html');
const backgroundColor = 'green'; // Set your desired background color here
const headers = JSON.stringify(req.headers, null, 2);

const path = req.url;
// Log access details to stdout
console.log(`[${new Date().toISOString()}] ${req.method} ${req.url}`);

Expand All @@ -34,6 +34,8 @@ const server = http.createServer((req, res) => {
<body>
<h1>Welcome to My Dummy Colored Page!</h1>
<h2>${version}</h2>
<p>HTTP Path: ${path}</p>
<p>HTTP Headers: ${path}</p>
<pre>${headers}</pre>
</body>
Expand Down
12 changes: 12 additions & 0 deletions gateway-api-stuff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ spec:
- matches:
- path:
value: /
- filters:
- type: RequestHeaderModifier
requestHeaderModifier:
add:
- name: my-header
value: foo
- type: URLRewrite
urlRewrite:
# hostname: elsewhere.example
path:
type: ReplacePrefixMatch
replacePrefixMatch: /newpath
backendRefs:
- name: dummy-v1-pink
port: 3000

0 comments on commit 4bb3f73

Please sign in to comment.