diff --git a/client/index.html b/client/index.html index b3fa63f..d6ee267 100644 --- a/client/index.html +++ b/client/index.html @@ -73,14 +73,18 @@ /** * Send command to the robot. * - * @param {string} endpoint Address IP of the robot + * @param {string} endpoint Address IP of the robot. * @param {Command} command Command to send. * @param {number} value Value of the command if needed. + * + * @returns {Promise} */ async function sendCommand(endpoint, command, value) { - const response = await fetch( - `http://${endpoint}/get?command=${command}&value=${value}` + const url = new URL( + `/get?command=${command}&value=${value}`, + endpoint ) + const response = await fetch(url) const text = await response.text() console.log(text) }