|
|
@@ -125,35 +125,11 @@ module.exports = function(exStore, exDir, testMode) {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * Get bare index without repo or examples,
|
|
|
- * for running tests with QUnit
|
|
|
- */
|
|
|
- getIndexTest: function(req, res) {
|
|
|
- renderIndex(req, false, false)
|
|
|
- .then(({ html, code }) => res.send(html));
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
* Get index with repo selected only
|
|
|
*/
|
|
|
getIndexRepo: function(req, res) {
|
|
|
renderIndex(req, true)
|
|
|
.then(({ html, code }) => res.status(code).send(html));
|
|
|
- // const repo = exStore.getRepo(req.params.repoSlug);
|
|
|
- // if(! repo) {
|
|
|
- // return res.status(404).send('Repo ' + req.params.repoSlug + ' not found');
|
|
|
- // }
|
|
|
- // const menuRepo = exStore.getRepoMenu();
|
|
|
- // const menuExample = exStore.getExampleMenu(repo.path);
|
|
|
- // // const title = 'Home';
|
|
|
- // // console.log(menuExample);
|
|
|
- // res.send(Mustache.render(indexTpml, {
|
|
|
- // // title,
|
|
|
- // menuRepo,
|
|
|
- // menuExample,
|
|
|
- // filesJSON: '[]'
|
|
|
- // }));
|
|
|
},
|
|
|
|
|
|
|
|
|
@@ -163,32 +139,6 @@ module.exports = function(exStore, exDir, testMode) {
|
|
|
getIndexExample: function(req, res) {
|
|
|
renderIndex(req, true, true)
|
|
|
.then(({ html, code }) => res.status(code).send(html));
|
|
|
- // console.log('getIndexExample', req.params);
|
|
|
- // const repo = exStore.getRepo(req.params.repoSlug);
|
|
|
- // if(! repo) {
|
|
|
- // return res.status(404).send('Repo ' + req.params.repoSlug + ' not found');
|
|
|
- // }
|
|
|
- // const menuRepo = exStore.getRepoMenu();
|
|
|
- // const menuExample = exStore.getExampleMenu(repo.path);
|
|
|
- // const example = _.find(repo.examples, { slug: req.params.exampleSlug });
|
|
|
- // if(! example) {
|
|
|
- // return res.status(404).send('Example ' + req.params.repoSlug + '/' + req.params.exampleSlug + ' not found');
|
|
|
- // }
|
|
|
- // // console.log('#1');
|
|
|
- // // const title = 'Home';
|
|
|
- // // console.log(menuExample);
|
|
|
- // const { repoSlug, exampleSlug } = req.params;
|
|
|
- // readExampleFiles(repoSlug, exampleSlug, example)
|
|
|
- // .then(files => {
|
|
|
- // console.log('example files', files);
|
|
|
- // res.send(Mustache.render(indexTpml, {
|
|
|
- // // title,
|
|
|
- // menuRepo,
|
|
|
- // menuExample,
|
|
|
- // files,
|
|
|
- // filesJSON: JSON.stringify(files)
|
|
|
- // }));
|
|
|
- // });
|
|
|
}
|
|
|
|
|
|
};
|