fix hardware stats API

This commit is contained in:
Anton Roslund 2025-03-30 16:43:20 +02:00
parent fd36e1b0a2
commit cadc78d1d4

View file

@ -1,10 +1,17 @@
const path = require('path');
const express = require('express');
const router = express.Router();
const protobufjs = require("protobufjs");
// create prisma db client
const { PrismaClient } = require("@prisma/client");
const prisma = new PrismaClient();
// load protobufs
const root = new protobufjs.Root();
root.resolvePath = (origin, target) => path.join(__dirname, "protos", target);
root.loadSync('meshtastic/mqtt.proto');
const HardwareModel = root.lookupEnum("HardwareModel");
router.get('/hardware-models', async (req, res) => {
try {