mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-16 04:44:35 +00:00
move old docs over
This commit is contained in:
14
site/src/routes/docs/index.json.js
Normal file
14
site/src/routes/docs/index.json.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import send from '@polka/send';
|
||||
import get_sections from './_sections.js';
|
||||
|
||||
let json;
|
||||
|
||||
export function get(req, res) {
|
||||
if (!json || process.env.NODE_ENV !== 'production') {
|
||||
json = JSON.stringify(get_sections()); // TODO it errors if I send the non-stringified value
|
||||
}
|
||||
|
||||
send(res, 200, json, {
|
||||
'Content-Type': 'application/json'
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user