DEV Community

Discussion on: How can I make a visual UI in the browser for a Node application?

Collapse
 
baenencalin profile image
Calin Baenen

All I want to do is link Node (as a backend) to a frontend (any GUI toolkit).

I'm making a Discord bot to be used as a an application (separate from Discord, but serving a similar purpose to).

Collapse
 
christiankozalla profile image
Christian Kozalla

let's say you use a React frontend with your Node backend. Then your backend might have a route /messages on which you can perform a GET request from your frontend, e.g.

fetch('https://yournodebackend.com/messages)
  .then(response => response.json())
  .then(jsonResponse => console.log(jsonResponse)) // or do whatever you like
Enter fullscreen mode Exit fullscreen mode

If your node backend supports more routes and request types like POST, PUT, DELETE, you can query them from your frontend similarly.

Hope, this could go in the right direction for your purpose..! Happy hacking 😄