added first pass of homepage
This commit is contained in:
24
api/src/routes/docs.ts
Normal file
24
api/src/routes/docs.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
|
||||
import { Request, Response } from 'express';
|
||||
import { requireLogin } from '../middleware/auth';
|
||||
|
||||
router.get('/welcome', [requireLogin], async (req: Request, res: Response) => {
|
||||
const output = await fetch(`${process.env.DOC_HOST}/api/pages/717`, {
|
||||
headers: {
|
||||
Authorization: `Token ${process.env.DOC_TOKEN_ID}:${process.env.DOC_TOKEN_SECRET}`,
|
||||
}
|
||||
})
|
||||
|
||||
if (output.ok) {
|
||||
const out = await output.json();
|
||||
res.status(200).json(out.html);
|
||||
} else {
|
||||
console.error("Failed to fetch LOA policy from bookstack");
|
||||
res.sendStatus(500);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
export const docsRouter = router;
|
||||
Reference in New Issue
Block a user