feat(api): public settings route (#57)

adds public settings route that provides initalized value to check if the app has been configured
for the first time
This commit is contained in:
sct
2020-09-07 18:41:20 +09:00
committed by GitHub
parent fcaabcb428
commit c0166e7ecb
4 changed files with 48 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import authRoutes from './auth';
import { checkUser, isAuthenticated } from '../middleware/auth';
import settingsRoutes from './settings';
import { Permission } from '../lib/permissions';
import { getSettings } from '../lib/settings';
const router = Router();
@@ -16,7 +17,13 @@ router.use(
);
router.use('/auth', authRoutes);
router.get('/', (req, res) => {
router.get('/settings/public', (_req, res) => {
const settings = getSettings();
return res.status(200).json(settings.public);
});
router.get('/', (_req, res) => {
return res.status(200).json({
api: 'Overseerr API',
version: '1.0',