diff options
Diffstat (limited to 'controllers/galleryController.js')
| -rw-r--r-- | controllers/galleryController.js | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/controllers/galleryController.js b/controllers/galleryController.js deleted file mode 100644 index 0f64086..0000000 --- a/controllers/galleryController.js +++ /dev/null @@ -1,34 +0,0 @@ -const config = require('../config.js') -const db = require('knex')(config.database) - -let galleryController = {} - -galleryController.list = function(req, res, next){ - - if(config.private === true) - if(req.headers.auth !== config.clientToken) - return res.status(401).send('not-authorized') - - db.table('gallery').select('id', 'name').then((galleries) => { - return res.json({ galleries }) - }) -} - -galleryController.test = function(req, res, next){ - - if(config.private === true) - if(req.headers.auth !== config.clientToken) - return res.status(401).send('not-authorized') - - let testdata = [ - {name: 'Test 1'}, - {name: 'Test 2'}, - {name: 'Test 3'}, - {name: 'Test 4'}, - {name: 'Test 5'} - ] - - db.table('gallery').insert(testdata).then(() => {}) -} - -module.exports = galleryController
\ No newline at end of file |