Skip to content

Commit

Permalink
Test new config
Browse files Browse the repository at this point in the history
  • Loading branch information
TaEduard committed Nov 6, 2023
1 parent d2e56a3 commit ba09662
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 53 deletions.
7 changes: 2 additions & 5 deletions helm/service/templates/sammwise.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ spec:
image: {{ .Values.sammwise.image | quote }}
# {{- if .Values.sammwise.NEXT_PUBLIC_BASE_PATH }}
env:
# - name: NEXT_PUBLIC_BASE_PATH
# value: {{ .Values.sammwise.NEXT_PUBLIC_BASE_PATH | quote }}
- name: RANCHER_SERVER
value: {{ .Values.sammwise.RANCHER_SERVER | quote }}

- name: NEXT_PUBLIC_BASE_PATH
value: {{ .Values.sammwise.NEXT_PUBLIC_BASE_PATH | quote }}
# {{- end }}
---
apiVersion: v1
Expand Down
3 changes: 1 addition & 2 deletions helm/service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ ingressHost: https://kubernetes.default.svc
sammwise:
image: sjultra/sammwise:latest
# port: 80
# NEXT_PUBLIC_BASE_PATH: "rancher.vzxy.net/k8s/clusters/c-m-26nk9h9f/api/v1/namespaces/sammwise/services/http:sammwise:80/proxy"
RANCHER_SERVER: "rancher.vzxy.net/k8s/clusters/c-m-26nk9h9f/api/v1/namespaces/sammwise/services/http:sammwise:80/proxy"
NEXT_PUBLIC_BASE_PATH: "/k8s/clusters/c-m-26nk9h9f/api/v1/namespaces/sammwise/services/http:sammwise:80/proxy"

# issuer:
# issuerEmail: [email protected]
Expand Down
40 changes: 0 additions & 40 deletions index.js

This file was deleted.

64 changes: 59 additions & 5 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,67 @@
module.exports = {
basePath: process.env.NEXT_BASE_PATH || '',
assetPrefix: process.env.NEXT_BASE_PATH || '',

// assetPrefix: process.env.RANCHER_SERVER || '',
hostname: process.env.RANCHER_SERVER,
// hostname: process.env.RANCHER_SERVER,
// images: {
// path: process.env.NEXT_PUBLIC_BASE_PATH || '',
// },

publicRuntimeConfig: {
hmrEndpoint: 'wss://'+process.env.RANCHER_SERVER+process.env.NEXT_PUBLIC_BASE_PATH,
webSocketBasePath: 'wss://'+process.env.RANCHER_SERVER+process.env.NEXT_PUBLIC_BASE_PATH,
// publicRuntimeConfig: {
// hmrEndpoint: 'wss://'+process.env.RANCHER_SERVER+process.env.NEXT_PUBLIC_BASE_PATH,
// webSocketBasePath: 'wss://'+process.env.RANCHER_SERVER+process.env.NEXT_PUBLIC_BASE_PATH,
// }


async rewrites() {
return [
{
source: '/',
destination: process.env.NEXT_BASE_PATH // Proxy to Backend
},
{
has: [
{
type: 'host',
value: 'rancher.vzxy.net',
},
],
source: '/',
destination: process.env.NEXT_BASE_PATH // Proxy to Backend
},
{
has: [
{
type: 'host',
value: 'rancher.vzxy.net',
},
],
source: '/about',
destination: process.env.NEXT_BASE_PATH + '/about' // Proxy to Backend
},
{
has: [
{
type: 'host',
value: 'rancher.vzxy.net',
},
],
source: '/assessment',
destination: process.env.NEXT_BASE_PATH + '/assessment' // Proxy to Backend
},
{
has: [
{
type: 'host',
value: 'rancher.vzxy.net',
},
],
source: '/results',
destination: process.env.NEXT_BASE_PATH + '/results' // Proxy to Backend
}
]
}
};
}


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "node index.js",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
Expand Down

0 comments on commit ba09662

Please sign in to comment.