Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod: server config.yaml #34

Merged
merged 1 commit into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ Attention: the file under these packages is compiled under Linux environment, ca
},
```

- Modify proxy setting: `./vendors/config-release.yaml`
- Modify proxy setting: `./config.yaml`
```
port: 7003
proxy:
gateway:
target: "127.0.0.1:8090" // change gateway service proxy
prometheus:
target: "127.0.0.1:9091" // change prometheus service proxy
target: "127.0.0.1:9090" // change prometheus service proxy
```
- Start:
```bash
Expand Down
6 changes: 5 additions & 1 deletion server/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ proxy:
gateway:
target: "http://localhost:8080"
prometheus:
target: "192.168.8.157:9090"
target: "192.168.8.157:9090"
nebulaServer:
ip: "192.168.8.145",
port: 9669

11 changes: 7 additions & 4 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const express = require('express');
const { createProxyMiddleware } = require('http-proxy-middleware');
const history = require('connect-history-api-fallback');
const fs = require('fs');
const path = require('path');
const pkg = require('../package.json');
const yaml = require('js-yaml');
let config = {};
Expand All @@ -14,7 +13,7 @@ try {
throw new Error(e);
}

const { proxy, port = 7003 } = config;
const { proxy,nebulaServer, port = 7003 } = config;

if (!proxy) {
throw new Error('no proxy found in config.yaml');
Expand Down Expand Up @@ -57,11 +56,15 @@ app.get('/api/app', (_req, res) => {
});

app.get('/api/config/custom', async (_req, res) => {
const data = await fs.readFileSync(path.join(__dirname, '../static/custom.json'), 'utf8');
if (data) {
res.send({
code: 0,
data: JSON.parse(data)
data: {
connection: nebulaServer,
alias: {
"ip:port": "instance1"
},
}
});
} else {
res.send({
Expand Down