From 8ce13d01c35754a09abd6a46ab04e28d4384c882 Mon Sep 17 00:00:00 2001 From: lyx0 <66651385+lyx0@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:24:19 +0200 Subject: [PATCH] get commandname from url --- web/src/Command/Command.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/Command/Command.jsx b/web/src/Command/Command.jsx index d7c86b8..82417d1 100644 --- a/web/src/Command/Command.jsx +++ b/web/src/Command/Command.jsx @@ -12,7 +12,8 @@ class Command extends React.Component { componentDidMount() { - fetch(`http://localhost:3000/v1/commands/test`) + const commandName = window.location.pathname + fetch(`http://localhost:3000/v1${commandName}`) .then(res => res.json()) .then( (result) => {