mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-21 21:50:49 +02:00

* feat: Add banner schema and model * feat: Add optional JwtAuth To handle the conditional logic with and without authentication within the model. * feat: Add an endpoint to retrieve a banner * feat: Add implementation for client to use banner and access API * feat: Display a banner on UI * feat: Script for updating and deleting banners * style: Update banner style * fix: Adjust the height when the banner is displayed * fix: failed specs
15 lines
426 B
JavaScript
15 lines
426 B
JavaScript
const express = require('express');
|
|
|
|
const { getBanner } = require('~/models/Banner');
|
|
const optionalJwtAuth = require('~/server/middleware/optionalJwtAuth');
|
|
const router = express.Router();
|
|
|
|
router.get('/', optionalJwtAuth, async (req, res) => {
|
|
try {
|
|
res.status(200).send(await getBanner(req.user));
|
|
} catch (error) {
|
|
res.status(500).json({ message: 'Error getting banner' });
|
|
}
|
|
});
|
|
|
|
module.exports = router;
|