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

Development to main #13

Merged
merged 1 commit into from
Jun 7, 2024
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 operations/deploy-stage.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ job "api-service-stage" {
}
}

volume "api-service-live" {
volume "api-service-stage" {
type = "host"
read_only = false
source = "api-service-live"
source = "api-service-stage"
}

task "api-service-stage-task" {
Expand Down
31 changes: 31 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@types/cors": "^2.8.17",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.30",
"@types/supertest": "^6.0.2",
Expand All @@ -24,6 +25,7 @@
"@types/express": "^4.17.21",
"@types/geoip-lite": "^1.4.4",
"axios": "^1.6.8",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.19.1",
"express-validator": "^7.1.0",
Expand Down
6 changes: 5 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import express from 'express';
import bodyParser from 'body-parser';
import cors from 'cors';
import { body, validationResult } from 'express-validator';
import { VictoriaMetricsService } from './VictoriaMetricsService';
import { OnionooService, HardwareInfo } from './OnionooService';
Expand All @@ -11,6 +12,7 @@ dotenv.config();

const app = express();
app.use(bodyParser.json());
app.use(cors());
const PORT = process.env.PORT ?? 3000;
const vmService = new VictoriaMetricsService(process.env.VICTORIA_METRICS_ADDRESS as string);

Expand Down Expand Up @@ -72,7 +74,9 @@ app.get('/relays/:fingerprint', async (req, res) => {
const relay = {
fingerprint: foundRelay.fingerprint,
running: foundRelay.running,
consensus_weight: foundRelay.consensus_weight
consensus_weight: foundRelay.consensus_weight,
observed_bandwidth: foundRelay.observed_bandwidth,
measured: foundRelay.measured
};
console.log('Relay:', relay);
return res.json(relay);
Expand Down
Loading