I use Vue on the front. There, I set up a vue-router to give the relevant pages for specific requests. On the back, I use node / express. The question is: when I write the full path to a component in the address bar, it gives the page and everything is ok, but if I specify the URL there, which I use as an endpoint in any of the get requests of my api, for example router.get('/users', (req, res) => {res.send(users)}) , then it gives JSON with all users from the database. But this is not normal, there is email, names, etc. The password is of course hashed, but nonetheless. How to avoid it? A piece of my app.js node:
const routes = require("./routes"); app.use("/", routes); app.use(history({ verbose: true, index: '/' })); app.get("/", function(req, res, next) { if(checkRoutes(req.originalUrl)) { res.sendFile(__dirname + '/dist/index.html'); } }); Here checkRoutes (url) checks for the presence of such a route in the vue-router.