Skip to content

Commit

Permalink
Try fix unit path
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Jul 19, 2024
1 parent 873f822 commit 18c473f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/controllers/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import { checkGet } from '../util.js';

export default function () {
var router = express.Router();
router.get('/config/*', async function (req, res, next) {
router.get('/config', async function (req, res, next) {
try {
let result = await unitExec.get("/config" + req.path);
let result = await unitExec.get(req.path);
res.header("content-type", "application/json")
res.status(200).send(result.stdout);
} catch (error) {
next(error);
}
});
router.get('/status/*', async function (req, res, next) {
router.get('/status', async function (req, res, next) {
try {
let result = await unitExec.get("/status" + req.path);
let result = await unitExec.get(req.path);
res.header("content-type", "application/json")
res.status(200).send(result.stdout);
} catch (error) {
Expand Down

0 comments on commit 18c473f

Please sign in to comment.