add: added user pages, and last messages to the home page

This commit is contained in:
Lukian 2025-03-25 16:47:30 +01:00
parent d7af341ca2
commit 87e7c44a5b
10 changed files with 155 additions and 31 deletions

14
back/api/lastmessages.js Normal file
View file

@ -0,0 +1,14 @@
const express = require('express');
const jwt = require('jsonwebtoken');
const { getConnection, getLastMessages } = require('../libs/mysql');
const router = express.Router();
router.get('/', async (req, res) => {
const connection = await getConnection();
const messages = await getLastMessages(connection);
connection.end();
res.send(messages);
});
module.exports = router;