mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-11 19:04:30 +00:00
15 lines
363 B
JavaScript
15 lines
363 B
JavaScript
import send from '@polka/send';
|
|
import generate_docs from '../../utils/generate_docs.js';
|
|
|
|
let json;
|
|
|
|
export function get(req, res) {
|
|
if (!json || process.env.NODE_ENV !== 'production') {
|
|
json = JSON.stringify(generate_docs('docs')); // TODO it errors if I send the non-stringified value
|
|
}
|
|
|
|
send(res, 200, json, {
|
|
'Content-Type': 'application/json'
|
|
});
|
|
}
|