One piece of code works perfectly fine:
const express = require('express');
const Router = express.Router();
Router.get('/hello-world', (req, res, next) => {
res.send("hello world!"); //works great
});
However, the other code snippet encounters issues:
const {Router} = require('express');
Router.get('/hello-world', (req, res, next) => {
res.send("hello world!"); // :( doesnt work
});
I seem to be missing something about destructuring. Any ideas or suggestions would be appreciated. Thank you!